Created
May 20, 2023 10:57
-
-
Save diecknet/7d68a598f9095dff6bd92abd7faf051d to your computer and use it in GitHub Desktop.
PowerShell Switch Beispiel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
switch(Get-Date) { | |
# $PSItem ist übrigens das gleiche wie $_ | |
{$PSItem.Year -gt 2022} { | |
"Es ist nach 2022" | |
break | |
} | |
default { | |
"Es ist vor 2023" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment