I am trying to write a script that will search our computers for certain windows updates and if it finds the update then it uninstalls the update on the computer. Currently it is not restarting. I am using an update on the VM that I know is installed to test. It is quiet but it will not reboot. Any idea what I am doing wrong or what I should change?
if ((
gwmi -cl win32_reliabilityRecords `
-filter "sourcename = 'Microsoft-Windows-WindowsUpdateClient'" | `
where { $_.message -match 'KB2912208' } | `
select -expand message)) `
{
'wusa.exe /uninstall /kb:2912208 /quiet /forcerestart'
}