I created a script to generate an HTML file containing information about the services on a computer, along with some additional styling.
$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
Nevertheless, I am not satisfied with the font being used. I would like to implement the Ubuntu font from Google Fonts. Despite my efforts, the code I added does not seem to take effect:
$a = $a + "@import url('https://fonts.googleapis.com/css?family=Ubuntu');"
$a = $a + "font-family: 'Ubuntu', sans-serif;"
What steps should I follow next to make this change?
Google's Recommendations
To incorporate your preferred fonts into a webpage, insert this code within the section of your HTML document:
<style>
@import url('https://fonts.googleapis.com/css?family=Ubuntu');
</style>
Utilize the following CSS rules to define these font families:
font-family: 'Ubuntu', sans-serif;