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 / How to pass input vari...
Power Automate
Answered

How to pass input variables into powershell scripts?

(0) ShareShare
ReportReport
Posted on by 48

Hello everyone,

I am trying to pass an input variable, but without luck.

This is my flow, with Run PS Script step:

maltiser_0-1666182755855.png

This is my script, where that I am using in this test:

 

 

param($NewInput)
 Write-Output $NewInput
 $var2out = "out"
 Write-Output $var2out

 

 

As an output I am getting this:

 

maltiser_1-1666182812923.png

 

That first line to show $var1in on PS script seems not having any effect, with or without it, output remains the same, and it doesn't identify that variable as an input.

 

How are you doing with these situations?

I have the same question (0)
  • Verified answer
    maltiser Profile Picture
    48 on at

    After a lot of trial an error, I finally was able to pass those arguments, through this way (without the need of setting up like an input argument but declaring it already as a local variable of that PS script):

     

    maltiser_0-1666188912474.png

     

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 271 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 171 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 148 Super User 2026 Season 2

Last 30 days Overall leaderboard