You are here:

WindowsManagement.com > PowerShell > PowerShell 1.0 > ConvertTo-Html
ActiveXperts Network Monitor 2015 proactively manages network servers, devices, databases and more.

ConvertTo-Html - PowerShell 1.0

Microsoft Windows PowerShell is a command-line shell and scripting tool based on the Microsoft .NET Framework. It is designed for system administrators, engineers and developers to control and automate the administration of Windows and applications.

More than hundred command-line tools (so called "cmdlets") can be used to perform system administration tasks and Windows Management Instrumentation (WMI). These cmdlets are easy to use, with standard naming conventions and common parameters, and standard tools for piping, sorting, filtering, and formatting data and objects.

ConvertTo-Html


Description
Back up your Hyper-V VMs Easy & Fast. 100% built for Hyper-V. Free for 2 VMs, forever.

Usage


Options
-inputObject psobject
        The objects to represent as an HTML table. 
        A variable that contains the objects or a command/expression
        that gets the objects.

    -property Object
        Properties of the input object to appear in the HTML table.
        
    -body string
        Text to include in the  element of the HTML.

    -head string
        Text to include in the  element of the HTML output.
        
    -title string
        Text to include in the  element of the HTML output.

    CommonParameters
        The common parameters: -Verbose, -Debug,-ErrorAction, -ErrorVariable, -OutVariable

<u>Example(s)</u>
Display the date as HTML on the console :

PS C:\>get-date | convertto-html

Save the system processes to C:\processes.html

PS C:\>Get-Process | ConvertTo-Html name,path,fileversion | Set-Content c:\processes.htm

Save the system services to C:\services.html

PS C:\>get-service | ConvertTo-Html -Title "Services" -Body "<H2>The result of get-service</H2> " -Property Name,Status  >  c:\services.html

Save the system services to C:\services.html and format in color:

PS C:\>get-service | ConvertTo-Html -Title "Services" -Body "<H2>The result of get-service</H2> " -Property Name,Status |
foreach {if($_ -like "*<td>Running</td>*"){$_ -replace "<tr>", "<tr bgcolor=green>"}elseif($_ -like "*<td>Stopped</td>*"){$_ -replace "<tr>", "<tr bgcolor=red>"}else{$_}}   >  c:\services.html

</pre>


            
            <!-- /// F O O T E R   B A N N E R /// -->
            
            
          </div><!-- /page -->
        </div><!-- /contents_inner -->
      </div><!-- /contents -->
      <div id="ax_footer" class="ax_clear">
        <div id="ax_footer_inner">
          <div id="ax_footer_content">

            <div class="ax_column">
              <h1>Featured Products</h1>
              <ul>
                <li><a href="/product/activexperts-network-monitor/">Active<span class="ax_x">X</span>perts Network Monitor</a>
                  
                    <select style="text-align:left; font-size: 8pt" size="1" name="select" onchange="MM_jumpMenu('parent',this,0)">
                      <option value="">Built-in checks...</option>
                      
                          <option value="/product/activexperts-network-monitor/virtualization/">[Monitor Virtualization]</option>
                        
                          <option value="/product/activexperts-network-monitor/virtualization/vmware-esxi/">  VMware ESXi</option>
                        
                          <option value="/product/activexperts-network-monitor/virtualization/citrix-xenserver/">  Citrix XenServer</option>
                        
                          <option value="/product/activexperts-network-monitor/virtualization/microsoft-hyper-v/">  Microsoft Hyper-V</option>
                        
                          <option value="/product/activexperts-network-monitor/virtualization/virtual-bridges-verde/">  Virtual Bridges VERDE</option>
                        
                          <option value="/product/activexperts-network-monitor/ip/">[Monitor Internet Protocols]</option>
                        
                          <option value="/product/activexperts-network-monitor/ip/dhcp/">  DHCP</option>
                        
                          <option value="/product/activexperts-network-monitor/ip/dns/">  DNS</option>
                        
                          <option value="/product/activexperts-network-monitor/ip/ftp/">  FTP</option>
                        
                          <option value="/product/activexperts-network-monitor/ip/http/">  HTTP(s)</option>
                        
                          <option value="/product/activexperts-network-monitor/ip/icmp/">  ICMP Ping</option>
                        
                          <option value="/product/activexperts-network-monitor/ip/imap/">  IMAP</option>
                        
                          <option value="/product/activexperts-network-monitor/ip/ldap/">  LDAP</option>
                        
                          <option value="/product/activexperts-network-monitor/ip/nntp/">  NNTP</option>
                        
                          <option value="/product/activexperts-network-monitor/ip/ntp/">  NTP</option>
                        
                          <option value="/product/activexperts-network-monitor/ip/pop3/">  POP3</option>
                        
                          <option value="/product/activexperts-network-monitor/ip/radius/">  RADIUS</option>
                        
                          <option value="/product/activexperts-network-monitor/ip/sftp/">  SFTP</option>
                        
                          <option value="/product/activexperts-network-monitor/ip/smpp/">  SMPP</option>
                        
                          <option value="/product/activexperts-network-monitor/ip/smtp/">  SMTP</option>
                        
                          <option value="/product/activexperts-network-monitor/ip/smtppop3/">  SMTP/POP3 Roundtrip</option>
                        
                          <option value="/product/activexperts-network-monitor/ip/snmpget/">  SNMP GET</option>
                        
                          <option value="/product/activexperts-network-monitor/ip/snmptrap/">  SNMP Traps</option>
                        
                          <option value="/product/activexperts-network-monitor/ip/tcp/">  TCP</option>
                        
                          <option value="/product/activexperts-network-monitor/ip/tftp/">  TFTP</option>
                        
                          <option value="/product/activexperts-network-monitor/ip/traceroute/">  TraceRoute</option>
                        
                          <option value="/product/activexperts-network-monitor/windows-servers/">[Monitor Windows Servers]</option>
                        
                          <option value="/product/activexperts-network-monitor/windows-servers/microsoft-active-directory/">  MS Active Directory</option>
                        
                          <option value="/product/activexperts-network-monitor/windows-servers/microsoft-biztalk/">  MS BizTalk</option>
                        
                          <option value="/product/activexperts-network-monitor/windows-servers/microsoft-dynamics-nav/">  MS Dynamics NAV</option>
                        
                          <option value="/product/activexperts-network-monitor/windows-servers/microsoft-dynamics-ax/">  MS Dynamics AX</option>
                        
                          <option value="/product/activexperts-network-monitor/windows-servers/microsoft-dynamics-crm/">  MS Dynamics CRM</option>
                        
                          <option value="/product/activexperts-network-monitor/windows-servers/microsoft-dynamics-gp-sl/">  MS Dynamics GP/SL</option>
                        
                          <option value="/product/activexperts-network-monitor/windows-servers/microsoft-exchange/">  MS Exchange Server</option>
                        
                          <option value="/product/activexperts-network-monitor/windows-servers/microsoft-forefront/">  MS Forefront TMG</option>
                        
                          <option value="/product/activexperts-network-monitor/windows-servers/microsoft-iis/">  MS IIS Server</option>
                        
                          <option value="/product/activexperts-network-monitor/windows-servers/microsoft-index/">  MS Index Server</option>
                        
                          <option value="/product/activexperts-network-monitor/windows-servers/microsoft-isa/">  MS ISA Server</option>
                        
                          <option value="/product/activexperts-network-monitor/windows-servers/microsoft-sharepoint/">  MS SharePoint Server</option>
                        
                          <option value="/product/activexperts-network-monitor/windows-servers/microsoft-sql/">  MS SQL Server</option>
                        
                          <option value="/product/activexperts-network-monitor/windows/">[Monitor Windows]</option>
                        
                          <option value="/product/activexperts-network-monitor/windows/antivirus/">  Anti-Virus/InternetSecurity</option>
                        
                          <option value="/product/activexperts-network-monitor/windows/ica/">  Citrix ICA</option>
                        
                          <option value="/product/activexperts-network-monitor/windows/xenapp/">  Citrix XenApp</option>
                        
                          <option value="/product/activexperts-network-monitor/windows/cpu/">  CPU Usage</option>
                        
                          <option value="/product/activexperts-network-monitor/windows/directory/">  Directory</option>
                        
                          <option value="/product/activexperts-network-monitor/windows/diskdrives/">  Disk Drives</option>
                        
                          <option value="/product/activexperts-network-monitor/windows/diskspace/">  Disk Space</option>
                        
                          <option value="/product/activexperts-network-monitor/windows/eventlog/">  Event Log</option>
                        
                          <option value="/product/activexperts-network-monitor/windows/file/">  File</option>
                        
                          <option value="/product/activexperts-network-monitor/windows/memory/">  Memory Usage</option>
                        
                          <option value="/product/activexperts-network-monitor/windows/msmq/">  MSMQ</option>
                        
                          <option value="/product/activexperts-network-monitor/windows/mstse/">  MS Terminal Server</option>
                        
                          <option value="/product/activexperts-network-monitor/windows/performance-counters/">  Performance Counters</option>
                        
                          <option value="/product/activexperts-network-monitor/windows/powershell/">  PowerShell</option>
                        
                          <option value="/product/activexperts-network-monitor/windows/printer/">  Printer</option>
                        
                          <option value="/product/activexperts-network-monitor/windows/process/">  Process</option>
                        
                          <option value="/product/activexperts-network-monitor/windows/registry/">  Registry</option>
                        
                          <option value="/product/activexperts-network-monitor/windows/rcmd/">  Remote Command</option>
                        
                          <option value="/product/activexperts-network-monitor/windows/removable-drives/">  Removable Drives</option>
                        
                          <option value="/product/activexperts-network-monitor/windows/scheduledtask/">  Scheduled Task</option>
                        
                          <option value="/product/activexperts-network-monitor/windows/service/">  Service</option>
                        
                          <option value="/product/activexperts-network-monitor/windows/vbscript/">  VBScript</option>
                        
                          <option value="/product/activexperts-network-monitor/windows/windows-defender/">  Windows Defender</option>
                        
                          <option value="/product/activexperts-network-monitor/linux/">[Monitor Linux / Unix]</option>
                        
                          <option value="/product/activexperts-network-monitor/linux/ssh/">  SSH</option>
                        
                          <option value="/product/activexperts-network-monitor/linux/rsh/">  RSH</option>
                        
                          <option value="/product/activexperts-network-monitor/database/">[Monitor Database]</option>
                        
                          <option value="/product/activexperts-network-monitor/database/query/">  IBM DB2</option>
                        
                          <option value="/product/activexperts-network-monitor/database/query/">  Informix</option>
                        
                          <option value="/product/activexperts-network-monitor/database/query/">  MS Access</option>
                        
                          <option value="/product/activexperts-network-monitor/database/query/">  MS SQL</option>
                        
                          <option value="/product/activexperts-network-monitor/database/query/">  MySQL</option>
                        
                          <option value="/product/activexperts-network-monitor/database/odbc/">  ODBC</option>
                        
                          <option value="/product/activexperts-network-monitor/database/oracle/">  Oracle</option>
                        
                          <option value="/product/activexperts-network-monitor/database/query/">  Progress</option>
                        
                          <option value="/product/activexperts-network-monitor/database/query/">  Paradox</option>
                        
                          <option value="/product/activexperts-network-monitor/database/query/">  SyBase</option>
                        
                          <option value="/product/activexperts-network-monitor/environmental/">[Monitor Environmental]</option>
                        
                          <option value="/product/activexperts-network-monitor/environmental/temperature/">  Temperature</option>
                        
                          <option value="/product/activexperts-network-monitor/environmental/humidity/">  Humidity</option>
                        
                          <option value="/product/activexperts-network-monitor/environmental/wetness/">  Wetness</option>
                        
                          <option value="/product/activexperts-network-monitor/misc/power/">  Power</option>
                        
                          <option value="/product/activexperts-network-monitor/environmental/light/">  Light</option>
                        
                          <option value="/product/activexperts-network-monitor/environmental/motion/">  Motion</option>
                        
                          <option value="/product/activexperts-network-monitor/environmental/smoke/">  Smoke</option>
                        
                          <option value="/product/activexperts-network-monitor/misc/door/">  Door (open/close)</option>
                        
                          <option value="/product/activexperts-network-monitor/environmental/resistance/">  Resistance</option>
                        
                          <option value="/product/activexperts-network-monitor/misc/switch/">  Switch (NO/NC)</option>
                        
                          <option value="/product/activexperts-network-monitor/misc/">[Monitor Miscellaneous]</option>
                        
                          <option value="/product/activexperts-network-monitor/misc/usergroup/">  User/groups</option>
                        
                          <option value="/product/activexperts-network-monitor/misc/serial/">  Serial Device</option>
                        
                    </select>
                                 
                </li>
                <li><a href="/product/axence-nvision-pro/">Axence nVision Pro</a></li>
              </ul>
            </div><!-- /ax_column -->
            
            <div class="ax_column">
              <h1>Resources</h1>
              <ul>
                <li><a href="/submit/">Submit a program</a></li>
                <li><a href="/sponsor/">Sponsor a category</a></li>
              </ul>
            </div><!-- /ax_column -->

            <div class="ax_column">
              <h1>Related websites</h1>
              <ul>
                <li>
                  <a target="_blank" href="http://adminfavorites.com/">AdminFavorites.com</a><br />
                  <small>Internet resource for ICT administrators and operators.</small>
                </li>
                <li>
                  <a target="_blank" href="http://monitortools.com/">MonitorTools.com</a><br />
                  <small>Internet resource for ICT administrators and operators.</small>
                </li>
                <li>
                  <a target="_blank" href="http://windowsmanagement.com/">WindowsManagement.com</a><br />
                  <small>Internet Resource for Windows management software.</small>
                </li>
              </ul>
            </div><!-- /ax_column -->
            
            <div class="ax_column">
              <h1> </h1>
              <ul>
                <li>
                  <a target="_blank" href="http://windowsshareware.com/">WindowsShareware.com</a><br />
                  <small>Internet Resource for Windows shareware software.</small>
                </li>
                <li>
                  <a target="_blank" href="http://windowstoolkits.com/">WindowsToolkits.com</a><br />
                  <small>Internet Resource for Windows toolkit software.</small>
                </li>
              </ul>
            </div><!-- /ax_column -->            
            
          </div><!-- /ax_footer_content -->
          
          <div id="ax_footer_menu">
            <p class="ax_nocss">Footer Navigation</p>
            <ul>
              <li class="ax_first"><a href="mailto:webmaster@adminfavorites.com">Contact Us</a></li>
              <li><a href="/termsofuse/">Terms of Use</a></li>
              <li><a href="/privacypolicy/">Privacy Policy</a></li>
              <li class="ax_last">© 2018 
                <a href="#ax_header" title="Top"><b>Windows<span id="ax_brandingtext">Management</span>.com</b></a> 
                All rights reserved.</li>
            </ul>
          </div><!-- /footernav -->
          <div id="ax_developedby"><a href="http://www.gxpmedia.com/" target="_blank">Developed by GXPMEDIA.COM</a></div><!-- /ax_developedby -->                    
        </div><!-- /ax_footer_inner -->
      </div><!-- /footer -->
    </div><!-- Wrapper -->
  </body>
</html>