Skip to content

Instantly share code, notes, and snippets.

Last active April 4, 2018 16:53
What would you like to do?
BLOG: example of how to work arround Get-WindowsUpdateLog console issues in a SCCM Configuration Item
Search WindowsUpdate Logs
Searches the Windows Update Log for a string
Ready to be used within a
Copyright Keith Garner, All rights reserved.
$ETLPath = "$env:WinDir\Logs\WindowsUpdate"
$WULog = New-TemporaryFile
# Hack Hack to work arround Windows Update SCCM Config Item interop issue.
if ( -not ( test-path alias:out-default ) ) { new-alias Out-Default Write-Verbose -Scope global }
Get-WindowsUpdateLog -LogPath $WULog -ETLPath $ETLPath
remove-item alias:Out-Default -force -EA SilentlyContinue
$WUResults = Select-String -path $WULog -Pattern $SearchString -AllMatches
if ( $WUResults ) {
write-host "Not Compliant $($WUResults.Count) $env:computerName"
$wuresults | out-string -Width 200 | write-verbose
else {
write-host "Compliant"
if ( $CleanWU ) {
write-verbose "Cleanup"
remove-item -Recurse -Force -Path $env:temp\WindowsUpdateLog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment