About 45,500 results
Open links in new tab
  1. Multiple -and -or in PowerShell Where-Object statement

    77 By wrapping your comparisons in {} in your first example you are creating ScriptBlocks; so the PowerShell interpreter views it as Where-Object { <ScriptBlock> -and <ScriptBlock> }. Since the -and …

  2. Filtering output using "Where-Object" in Powershell

    Feb 11, 2016 · I'm trying to get into PowerShell and have encountered my first hurdle. when I run Get-Command | Where-Object CommandType -contains Cmdlet My output gets filtered so that only …

  3. How to filter objects using -notcontains in Powershell

    Dec 23, 2021 · I'm trying to filter objects that don't contain the string &quot;C: \\ Windows&quot; in their path but the filtering isn't working well with $_.PathName parameter. function unquotedPath { $

  4. How to use Powershell Where-Object like an IN statement

    How to use Powershell Where-Object like an IN statement Asked 14 years, 3 months ago Modified 3 years, 9 months ago Viewed 28k times

  5. powershell - Where-Object, Select-Object and ForEach-object ...

    Jun 4, 2019 · Where-Object, Select-Object and ForEach-Object I am a PowerShell beginner. I don't understand too much. Can someone give examples to illustrate the differences and usage scenarios …

  6. powershell - Apply Where-Object shorthand operators to entire object ...

    Apr 23, 2025 · The question is explicitly about how to apply a Where-Object call to the input objects themselves rather than one of their properties, using simplified syntax.

  7. PowerShell How to use -and in Where-Object - Stack Overflow

    May 26, 2019 · PowerShell How to use -and in Where-Object Asked 6 years, 6 months ago Modified 6 years, 6 months ago Viewed 6k times

  8. PowerShell Where-Object $_.name -like -in $list - Stack Overflow

    Jun 16, 2015 · PowerShell Where-Object $_.name -like -in $list Asked 10 years, 5 months ago Modified 6 years, 11 months ago Viewed 63k times

  9. How to use Where-Object with StartsWith to filter Powershell …

    Feb 5, 2024 · I have a powershell script written by somebody else that makes use of uses the output of a command to filter and extract the results. I think I understand what it is attempting to do but not why …

  10. PowerShell Where-Object vs. Where method - Stack Overflow

    The (PowerShell v4+) .Where() method, which is evaluated in expression mode, always returns an instance of [System.Collections.ObjectModel.Collection[psobject]]: If no input objects match, that …