SnehaK
June 15, 2023, 5:37pm
1
hi
I am needing help trying to install an application with multiple paramaters. How do we need to send to exe? Confused with quotes below is the code to be sent
Qualysagent.exe Customerid=xxxxx Activationid=xxxxxxxx WebserviceUri=https:\xxxxx
Tried one:-
Doesn’t work, Please help
Execute-Process -Path 'Qualysagent.exe ' -Parameters "`"Customerid=xxxxx Activationid=xxxxxxxx WebserviceUri=https:\\xxxxx`"`""
First thing, that trailing space for the EXE might cause problems
Second, I don’t think you need to escape the double quotes for your parameters. None seem to have spaces.
If you are curious how escaping quotes work in PowerShell, look at Silent Install asks for input (InstallShield Quotes issue)
SnehaK
June 16, 2023, 5:22am
3
Thank you but still get error below error, Please help with quotes
Below works in cmd but not in PS script->
QualysCloudAgent.exe CustomerId={xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx} ActivationId={xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx} WebServiceUri=https://xxxxxxx.xxx.xxxx.qualys.com/CloudAgent/
Code tried →
Execute-Process -Path "$dirFiles\QualysCloudAgent.exe" -Parameters "`"CustomerId={xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx}`" `"ActivationId={xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx}`" WebServiceUri=https://xxxxxxx.xxx.xxxx.qualys.com/CloudAgent/`""
I think (as @That-Annoying-Guy inferred) your use of escaping the double quotes is not necessary (on this occasion)
Have you simply tried this (N.B. I also changed the Qualysagent.exe
from single quotes to double quotes):
Execute-Process -Path "$dirFiles\Qualysagent.exe" -Parameters "Customerid={xxxxx} Activationid={xxxxxxxx} WebserviceUri=https:\\xxxxx"
or maybe (Note: Escaped double quotes around WebServiceUri / Url):
Execute-Process -Path "$dirFiles\Qualysagent.exe" -Parameters "Customerid={xxxxx} Activationid={xxxxxxxx} WebserviceUri=`"https:\\xxxxx`""
It’s the {curly brackets} . They are reserved characters in PowerShell. Either remove them or escape them like this:
Execute-Process -Path "$dirFiles\QualysCloudAgent.exe" -Parameters "`"CustomerId=`{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx`}`" `"ActivationId=`{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx`}`" WebServiceUri=https://xxxxxxx.xxx.xxxx.qualys.com/CloudAgent/`""
FYI: I added triple back-ticks to your post where you posted code. it makes it possible to display back tick. (Discourse uses Markdown for formatting)
2 Likes
SnehaK
June 16, 2023, 3:47pm
6
This worked thanks but couldnt create log file.
Execute-Process -Path “$dirFiles\QualysCloudAgent.exe” -Parameters “CustomerId={xxxxx} ActivationId={xxxxx} WebServiceUri=https:/xxxxxxxx.xxx.xxxx.qualys.com/CloudAgent/”
Below is the log file failed code, maybe exe doesnt support log switch.
Execute-Process -Path "$dirFiles\QualysCloudAgent.exe" -Parameters "CustomerId={xxxxx} ActivationId={xxxxx} WebServiceUri=https:/xxxxxxxx.xxx.xxxx.qualys.com/CloudAgent/" /LOG=`"$configToolkitLogDir\$appPackageName.log`""
Thanks for the help!
you left the terminating double quote: CloudAgent/"
Try this:
Execute-Process -Path "$dirFiles\QualysCloudAgent.exe" -Parameters "CustomerId={xxxxx} ActivationId={xxxxx} WebServiceUri=https:/xxxxxxxx.xxx.xxxx.qualys.com/CloudAgent/ /LOG=`"$configToolkitLogDir\$appPackageName.log`""
I’m surprised that it’s /LOG and not -LOG like the other paramaters.
3 Likes
system
Closed
June 23, 2023, 3:53pm
8
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.