cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mpezzutti
Helper II
Helper II

Power Shell script

Hello everyone

I need a big help here I am writing a powershell script to execute from my powerapps. I pass three parameters into the flow which is the environment (ie Para1), User Guid(ie Para 2) and the APP ID GUid (ie Para 3). I need to make it run as a powershell script

 

Below is my code that is going to create a file in onedrive. I am just guessing this is the way to do it

 

param([string] $Environ = Para1,
[string] $Userguid = Para2,
[string] $Appguid = Para3
)
Remove-AdminPowerAppRoleAssignment -$Environ -AppName $Appguid -RoleId $Userguid

 

https://australia.flow.microsoft.com/manage/environments/ab6675c6-b992-4ca9-80d8-b87f1dfcb9d1/flows/... 

 

 

3 REPLIES 3
yashag2255
Dual Super User II
Dual Super User II

Hi @mpezzutti 

 

You cannot directly run a PowerShell script from Flow or PowerApps. You can invoke a function app or a script from Azure automation for something like this: http://johnliu.net/blog/2018/4/run-any-pnp-powershell-in-one-azurefunction-from-microsoft-flow 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Capture.PNG

 

 

I do not know if my coding is correct! Also I do not know if Im doing it correctly . What should I do after the one drive could you please indicate what I have to do in Azure Automation and the coding. Im really lost

 

Thanks Marco

Hi @mpezzutti 

 

It will not work like that. You might want to follow this blog here: https://practical365.com/microsoft-365/how-to-run-powershell-scripts-to-automate-manual-processes-in... 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (2,513)