Surpress Warning message

%3CLINGO-SUB%20id%3D%22lingo-sub-2380095%22%20slang%3D%22en-US%22%3ESurpress%20Warning%20message%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2380095%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20made%20below%20script%20and%20it%20is%20working%20fine%20but%20im%20not%20able%20to%20surpress%20warning%20message.%3C%2FP%3E%3CP%3Eanyone%20can%20assist%26nbsp%3B%3C%2FP%3E%3CP%3E%24CIID%20%3D%20Get-CMSoftwareUpdateGroup%20-Name%20%22Patching%202021-04-13%2010%3A36%3A11%22%20%7C%20%25%7B%24_.Updates%7D%3C%2FP%3E%3CP%3EForeach%20(%24CIIDs%20in%20%24CIID)%3CBR%20%2F%3E%7B%3CBR%20%2F%3ETry%20%7B%3CBR%20%2F%3EGet-CMSoftwareUpdate%20-Id%20%24CIIDs%20%7C%20%25%7B%24_.IsSuperseded%7D%20-WarningAction%20Ignore%3CBR%20%2F%3E%7D%20Catch%3CBR%20%2F%3E%7B%3CBR%20%2F%3EWrite-Warning%20%22%22%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWARNING%3A%20'Get-CMSoftwareUpdate'%20supports%20-Fast%20for%20retrieving%20objects%20without%20loading%20lazy%20properties.%20Loading%20lazy%20properties%20can%20cause%20significant%20performance%20penalties%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2380095%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Regular Visitor

I have made below script and it is working fine but im not able to surpress warning message.

anyone can assist 

$CIID = Get-CMSoftwareUpdateGroup -Name "Patching 2021-04-13 10:36:11" | %{$_.Updates}

Foreach ($CIIDs in $CIID)
{
Try {
Get-CMSoftwareUpdate -Id $CIIDs | %{$_.IsSuperseded} -WarningAction Ignore
} Catch
{
Write-Warning ""
}
}

 

WARNING: 'Get-CMSoftwareUpdate' supports -Fast for retrieving objects without loading lazy properties. Loading lazy properties can cause significant performance penalties

0 Replies