PowerShell: Convert String to Command
# Method 1 $command =@"ping google.com"@$scriptBlock = [Scriptblock]::Create($command)Invoke-Command -ComputerName localhost -ScriptBlock $scriptBlock# Method 2$xVariable="K1"$yVariable="ping"$commandString=$yVariable+" "+$xVariablefunction…
0 Comments