Skip to content

Instantly share code, notes, and snippets.

@guitarrapc
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guitarrapc/e7285c3c66e723e6d8cb to your computer and use it in GitHub Desktop.
Save guitarrapc/e7285c3c66e723e6d8cb to your computer and use it in GitHub Desktop.
MS14-045 issue check by piepline.
$message = "font '{0}' found! Your environmet will trouble with MS14-045. See https://support.microsoft.com/kb/2982791"
$fontregistory = 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\'
(Get-Item -Path $fontregistory).Property | % {(Get-ItemProperty -path $fontregistory).$_ | where {$_.EndsWith('.otf')} | where {Test-Path $_} | %{ Write-Host ($message -f $_) -ForegroundColor Red;return}}
Write-Host 'Your environment is OK.'
@guitarrapc
Copy link
Author

@guitarrapc
Copy link
Author

for v2

$message = "font '{0}' found! Your environmet will trouble with MS14-045. See https://support.microsoft.com/kb/2982791"
$fontregistory = 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts\'
(Get-Item -Path $fontregistory) | select -ExpandProperty Property | % {$x=$_; Get-ItemProperty -path $fontregistory | select -ExpandProperty $x | where {$_.EndsWith('.otf')} | where {Test-Path $_} | %{ Write-Host ($message -f $_) -ForegroundColor Red;return}}
Write-Host 'Your environment is OK.'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment