< Back

Set-DefaultPropertySet

Mon Jan 13, 2020 6:34 pm

NAME Set-DefaultPropertySet



SYNOPSIS

Sets the Default Display Property Set of an Object.





SYNTAX

Set-DefaultPropertySet [-Object] <PSObject[]> [-DisplaySet] <String[]> [-Force] [<CommonParameters>]





DESCRIPTION

The Set-DefaultPropertySet function sets the Default Display Property Set

of a PSCustomObject or collection of PSCustomObjects.



The Force switch can be specified to overwrite an existing Default Display

Property Set.





PARAMETERS

-Object <PSObject[]>

PSCustomObject(s) with an existing Default Display Property Set.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-DisplaySet <String[]>



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Force [<SwitchParameter>]

Specifies that an existing Default Display Property Set can be overwritten.



Required? false

Position? named

Default value False

Accept pipeline input? false

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:\\>Set-DefaultPropertySet -Object $DemoObject1 -DisplaySet 'Name', 'Date'



This command adds a Default Display Property Set to $DemoObject1 containing

the properties 'Name' and 'Date'.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>$DemoObject1, $DemoObject2 | Set-DefaultPropertySet -DisplaySet 'Name', 'Date'



This command takes two objects as input from the pipeline and adds a Default

Display Property Set to both objects containing the properties 'Name' and 'Date'.











RELATED LINKS

https://github.com/Windos/DefaultPropertySetter