TL; DR
Param (
[ValidateSet('Startup', 'Shutdown', 'LogOn', 'LogOff')]
[String] $Type = 'Startup'
)
$MyInvocation.MyCommand.Parameters['Type'].Attributes.ValidValues
, Set-StrictMode -version 2 PSv2,
Param (
[ValidateSet('Startup', 'Shutdown', 'LogOn', 'LogOff')]
[String] $Type = 'Startup'
)
($MyInvocation.MyCommand.Parameters['Type'].Attributes |
Where-Object { $_ -is [System.Management.Automation.ValidateSetAttribute] }).ValidValues
ISE , - (ISE ).
Dot-sourcing ( , ), , , .
dot-source a script , , , PS.
script $Type , .
, script (, script ./script.ps1: