< Back

Select-PSFPropertyValue

Sun Jan 19, 2020 6:44 pm

NAME Select-PSFPropertyValue



SYNOPSIS

Expand specific property values based on selection logic.





SYNTAX

Select-PSFPropertyValue [-Property] <String[]> [-InputObject <Object>] [<CommonParameters>]



Select-PSFPropertyValue [-Property] <String[]> [-Fallback] [-InputObject <Object>] [<CommonParameters>]



Select-PSFPropertyValue [-Property] <String[]> [-Select <String>] [-InputObject <Object>] [<CommonParameters>]



Select-PSFPropertyValue [-Property] <String[]> [-JoinBy <String>] [-InputObject <Object>] [<CommonParameters>]



Select-PSFPropertyValue [-Property] <String[]> [-FormatWith <String>] [-InputObject <Object>] [<CommonParameters>]





DESCRIPTION

This command allows picking a set of properties and then returning ...

- All their values

- The value that meets specific rules

- A composite value





PARAMETERS

-Property <String[]>

The properties to work with, in the order they should be considered.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Fallback [<SwitchParameter>]

Whether to fall back on other properties if the first one doesn't contain values.

This picks the value of the first property that actually has a value.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Select <String>

Select either the largest or lowest propertyvalue in the Propertynames specified.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-JoinBy <String>

Joins the selected properties by the string specified.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-FormatWith <String>

Formats the selected properties into the specified format string.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-InputObject <Object>

The object(s) whose properties to inspect.



Required? false

Position? named

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-ADComputer -Filter * | Select-PSFPropertyValue -Property 'DNSHostName', 'Name' -Fallback



For each computer in the domain, it will pick the DNSHostName if available, otherwise the Name.











RELATED LINKS