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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 608

#2
Valantis Profile Picture

Valantis 416

#3
11manish Profile Picture

11manish 348

Last 30 days Overall leaderboard