I have variable in variable group and I try to use them in Invoke-Command -ScriptBlock.
And is not found the variable, not success to reach to variables in variable group.
The script run in PowerShell, in release:
Invoke-Command -ComputerName X -ScriptBlock {
Write-Host $env:Mypod
}
I read about argument list, but I don't know how to use it.
$var1 = $env:Mypod Invoke-Command -ComputerName X -ScriptBlock { Write-Host $args[0] } -ArgumentList $var1