I would like to run the following command to execute some command in a new powershell instance.
start powershell {java -jar x.jar -url $URL/computer/$name/ -secret $secret; Read-Host}
I have $URL
and $name
and $secret
passed in as input parameters and I can echo their values without a problem.
The problem is that when the new powershell instance is started, it only sees
java -jar x.jar -url /computer// -secret
(i.e. the variable values have not been passed.) How can I solve this?
The full example script is:
param(
[parameter(Mandatory=$TRUE,Position=0)]
[string] $URL,
[parameter(Mandatory=$TRUE,Position=1)]
[string] $name,
[parameter(Mandatory=$TRUE,Position=2)]
[string] $secret
)
echo $URL
echo $name
echo $secret
start powershell {java -jar x.jar -url $URL/computer/$name/ -secret $secret; Read-Host}