Hi,
Here’s my issue :
- I’m calling a process from a PowerShell command line, and in the input section, I have a password which contains a dollar sign ($)
--input "{'password':'pass$word'}"
Why is that an issue :
- The UiRobot --input parameter takes a string containing a dictionnary/json
- Powershell strings are known to use the ($) as a splitter
The result I get :
- In the password area, it only types ‘pass’ instead of ‘pass$word’
I did some research and got this forum post that’s really similar :
Need to run UiRobot from Powershell with arguments containing an embedded quote
But since it did not cover my case, I did more research and got this StackOverflow post that gave me the answer :
Escaping dollar signs in Powershell path is not working
One of the solutions here worked, so since it’s both a rare but not that rare situation, I wanted to make this post to share my finding
Now, my command looks something like this and it works :
uirobot execute --process ProcessName --input "{'password':'pass`$word'}"
So using a ` as an escape character works in this scenario
Hope this helps people in the future