Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- param (
- $p1,
- [String]$Input_1
- )
- function Info([String]$s) {
- if ([String]::IsNullOrWhiteSpace($s)) {
- return 1
- }
- if ($s -eq '?' -or $s -eq 'help') {
- return 2
- }
- if ($s -eq '--help' -or $s -eq '--h') {
- return 3
- }
- if ($s -eq "-h") {
- return 4
- }
- }
- function test {
- $args
- foreach($arg in $args) {
- switch($arg) {
- '-h' { 'I got: -h' }
- '--help' { 'I got: --help' }
- default { "I got something: $arg" }
- }
- }
- }
- test($p1)
- # switch(Info($Input_1)) {
- # { $_ -eq 1 } {Write-Output "[ps-test] Usage: ps-test ... Variant 1"; Exit}
- # { $_ -eq 2 } {Write-Output "[ps-test] Usage: ps-test ... Variant 2"; Exit}
- # { $_ -eq 3 } {Write-Output "[ps-test] Usage: ps-test ... Variant 3"; Exit}
- # { $_ -eq 4 } {Write-Output "[ps-test] Usage: ps-test ... Variant 4"; Exit}
- # }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement