I am trying to run a Powershell script in UiPath and I am having issues with the get-clipboard command. The command just gets what’s in the clipboard and writes it to a word file. It works fine to run as a standalone. But when I use Run Powershell Script in UiPath it writes a blank line to the text file. If I change the variable to a string then it works.
Funny thing …
I’ve tested the behavior and the function does not return any value at all when invoked through UiPath (you can check it by returning the $data variable with PowerShellVariables in misc section of the Invoke Power Shell activity) … does not look like we can do anything about the way UiPath invokes the method
a possible, and more uipathy, workaround would be to:
get value from clipboard with Get From Clipboard activity
store retrieved value into a variable
pass the variable into Invoke Power Shell Parameters