web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Scripting Outputs caus...
Power Automate
Unanswered

Scripting Outputs causing Illegal Characters In Path Error

(0) ShareShare
ReportReport
Posted on by 65

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.

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 272 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 147 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 146 Super User 2026 Season 2

Last 30 days Overall leaderboard