Como ativo -one com o ambiente? "-one" acaba na string opts se eu não especificar um, ou será ignorado.
function test-run {
Param (
[switch]$one = $false,
[switch]$two = $false,
[switch]$tre = $false,
[string]$branch = "release",
[int]$forkid = -1,
[string]$opts = ""
)
"one: $one, two: $two, tre: $tre" | Out-Host
"branch: $branch, forkid: $forkid, opts: $opts" | Out-Host
}
$env:setupflag = "-one"
test-run $env:setupflag -two -tre -branch "test" -forkid 0 -opts ""
test-param
um: Falso, dois: Verdadeiro, tre: Verdadeiro
branch: teste, forkid: 0, opts: