Home Forums Programming Powershell Formatting output to pass as part of a where clause from Select_Object RE: Formatting output to pass as part of a where clause from Select_Object

  • Starting point:

    Get-ClusterResource | Where-Object -Property ResourceType -EQ "SQL Server Availability Group" | Select-Object Name

    Option 1: Just add -ExpandProperty to your select-object:

    Get-ClusterResource | Where-Object -Property ResourceType -EQ "SQL Server Availability Group" | Select-Object -ExpandProperty Name

    This will change the type to System.String and allow you to use it for your filter.

    Option 2: Specify the property name which you already deteremined

    Shawn Melton
    Twitter: @wsmelton
    Blog: wsmelton.github.com
    Github: wsmelton