Skip to content

Instantly share code, notes, and snippets.

@PythonCoderAS
Created November 17, 2016 00:55
Show Gist options
  • Select an option

  • Save PythonCoderAS/fa3f48673dc0baf90b18e6c6ec1e1c9c to your computer and use it in GitHub Desktop.

Select an option

Save PythonCoderAS/fa3f48673dc0baf90b18e6c6ec1e1c9c to your computer and use it in GitHub Desktop.
Services In HTML
$a = "<style>"
$a = $a + "BODY{background-color:peachpuff;}"
$a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
$a = $a + "TH{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:thistle}"
$a = $a + "TD{border-width: 1px;padding: 0px;border-style: solid;border-color: black;background-color:PaleGoldenrod}"
$a = $a + "strong{color: green;}"
$a = $a + "</style>"
$b = "<H2>Service Information</H2>"
$b = $b + "<p> This is the list of services that are on this system. It dispays <strong>both</strong> running and stopped services </p>"
Get-Service | Select-Object Status, Name, DisplayName |
ConvertTo-HTML -head $a -body $b |
Out-File C:\Scripts\Test.htm
start "C:\Users\neela\Desktop\Services In HTML.ps1"
Invoke-Expression C:\Scripts\Test.htm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment