Good morning,
please any idea how to simplify following complex PowerShell if statemant?
if ($child1 |
Where-Object {$_.operatingsystem -notlike "Windows RT*"} |
Where-Object {$_.operatingsystem -notlike "Microsoft Office Suite and Other Software"} |
Where-Object {$_.operatingsystem -notlike "Antimalware Software"} |
Where-Object {$_.operatingsystem -notlike "*for Mac*"} |
Where-Object {$_.operatingsystem -notlike "Office Software"} |
Where-Object {$_.operatingsystem -notlike "Software"} |
Where-Object {$_.operatingsystem -notlike "Affected Software"} |
Where-Object {$_.operatingsystem -notlike "File information"} |
Where-Object {$_.operatingsystem -notlike "SHA1/SHA2 hashes"} |
Where-Object {$_.operatingsystem -notlike "Known issues"} |
Where-Object {$_.operatingsystem -notlike "Operating System"} |
Where-Object {$_.operatingsystem -notlike "*Server*"} |
Where-Object {$_.operatingsystem -notlike "*Vista x64*" } |
Where-Object {$_.operatingsystem -notlike "*XP Professional x64*" } |
Where-Object {$_.operatingsystem -notlike "Microsoft Office Software" }
)
{$Parent += $Child1 }
Thank you :)