Problem
I was using the PowerShell command to run a Python script that outputs a full file path, then store that in a PAD variable. When trying to consume that variable using the 'Read text from file' command, I received an error indicating there were 'Illegal Characters In Path'. I could 'view' the value of the variable in Flow variables, then copy and paste that into the 'Read text from file' command and it would not produce the error.
Cause
After searching around I found a related post where a user pointed out that when printing to a console a carriage line return gets added to the end of the output. So when you store a console output into a Power Automate variable, it stores this carriage line return with it. This is what is causing the illegal characters in path error.
Solution
My solution to this was to do a 'Trim text' command to my file path variable after my PowerShell command and I was then able to consume the variable in the 'Read text from file' command.

Report
All responses (
Answers (