1 Pluspunkt 0 Minuspunkte

Wie kann ich einen Boolean Parameter für ein Powershell Script erstellen?

Param(
    [string]$Name,
    [int]$Age,
    [switch]$IsStudent
)
bezieht sich auf eine Antwort auf: Powershell Script mit Parameter
von  

1 Antwort

0 Pluspunkte 0 Minuspunkte

Mit dem Typ switch.

Param(
    [string]$Name,
    [int]$Age,
    [switch]$Verbose
)

if ($Verbose) {
    Write-Output "Verbose mode is enabled."
}
von (716 Punkte)