Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

How to simplify complex PowerShell if statemant?

$
0
0

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 :)




Viewing all articles
Browse latest Browse all 15028

Trending Articles