Where-Object scriptblock content as a variable

celsoglima 371 Reputation points

Do any of you guys know if I can pass the content of the scriptblock in a where-object statement as a variable, and if so, how it is done? I have been able to use that approach with commands that use -Filter as a parameter.

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,403 questions
0 comments No comments
{count} votes

1 additional answer

Sort by: Most helpful
  1. celsoglima 371 Reputation points

    @Michael Taylor , Thank you so much! That worked!

    0 comments No comments