$var01 = "Something" write-host '$var01' #Result is $var01 write-host "$var01" #Result is Something
I understand that basic concept.
I’ve got a two part question:
Can you splat variables when using the “&” tool to run .exe files?
$app = "C:\temp\someapp.exe" $varA = 'VarA="C:\Temp\TestPath"' #SingleQuote VarA = DoubleQuote C:\Temp\TestPath DoubleQuote SingleQuote $varb = 'VarB="%COMPUTERNAME%"' #SingleQuote VarB = DoubleQuote %COMPUTERNAME% DoubleQuote SingleQuote & $app $VarA $VarB
Second question is:
What’s the syntax to properly produce the following results:
$varA = ‘VarA=“C:\Temp$Var01”’
to make $varA return (as shown below).