Clear-Variable strHTML
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")$UserName = (Get-Item 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon').GetValue('DefaultUserName')
$objFonts = New-Object System.Drawing.Text.InstalledFontCollection
$colFonts = $objFonts.Families
$objIE = New-Object -com "InternetExplorer.Application"
$objIE.Navigate("about:blank")
$objIE.ToolBar = 0
$objIE.StatusBar = 0
$objIE.Visible = $True
$objDoc = $objIE.Document.DocumentElement.LastChild
foreach ($objFont in $colFonts)
{
$strHTML = $strHTML + "<font size='5' face='" + $objFont.Name + "'>" + 'This ' + $objFont.Name + ' font is on the computer of '+ $UserName + "</font><br>"
}
$objDoc.InnerHTML = $strHTML
No comments:
Post a Comment