I guess there are two issues.
- The Else statment outputs nothing.
- The get-ciminstance below Write-Host "Currently Installed Dell Update Versions:", does not display until the end of the script right above Write-Host "Complete"
[string[]] $DellUpdate_GUIDS = @(
#Dell Update 4.1.0
"{944FB5B0-9588-45FD-ABE8-73FC879801ED}",
#Dell SupportAssist OS Recovery Plugin for Dell Update 5.4.1.14954
"{900D0BCD-0B86-4DAA-B639-89BE70449569}"
)
#Show currently installed Dell Update Version(s)
Write-Host "Currently Installed Dell Update Versions:"
Get-CimInstance win32_product -filter "name like 'Dell%Update'" | Select-Object name,IdentifyingNumber,Version
[string[]] $Installed = (Get-CimInstance win32_product -filter "name like 'Dell%Update'" | Select-Object -expand IdentifyingNumber)
foreach($Installed_GUID in $Installed)
{
if ($DellUpdate_GUIDS -contains $Installed_GUID)
{
Write-Host "There is a match!"
}
else
{
Write-Host "Did NOT find $Installed_GUID in Dell Update GUIDS Array"
}
}
Write-Host "Complete"