Can I run PnP PowerShell or CSOM PowerShell using Flow ?

%3CLINGO-SUB%20id%3D%22lingo-sub-204295%22%20slang%3D%22en-US%22%3ECan%20I%20run%20PnP%20PowerShell%20or%20CSOM%20PowerShell%20using%20Flow%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-204295%22%20slang%3D%22en-US%22%3E%3CP%3EHi%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20want%20Flow%20to%20kick%20off%20a%20PnP%20Powershell%20script.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20seems%20a%20pretty%20out%20of%20the%20box%20sort%20of%20thing%20to%20want%20to%20do.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20I%20found%20anything%20on%20this%20%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENo%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnybody%20any%20ideas%20%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENigel%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-204295%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFlow%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPnP%20PowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-205489%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20run%20PnP%20PowerShell%20or%20CSOM%20PowerShell%20using%20Flow%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-205489%22%20slang%3D%22en-US%22%3E%3CP%3EDo%20do%20this%20I%20always%20use%20Azure%20Automation%20and%20call%20a%20Runbook%20from%20Flow.%26nbsp%3B%20Personally%2C%20I%20found%20that%20a%20lot%20simpler%20to%20get%20going%20with%20coming%20from%20an%20IT%20Pro%20background%2C%26nbsp%3B%20However%2C%20as%20others%20have%20said%2C%20I've%20also%20heard%20Azure%20Function%20work%20well.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20have%20Office%20365%2C%20you%20already%20have%20Azure%20to%20some%20extent%20for%20your%20Azure%20AD%20instance.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAlso%2C%20Azure%20Automation%20is%20free%20for%20the%20first%20500%20minutes%20of%20running%20PowerShell%2FRunbooks%2C%20so%20even%20if%20you%20need%20to%20create%20an%20Azure%20tenant%20to%20do%20it%2C%20you%20won't%20have%20to%20spend%20a%20dime%20unless%20you%20have%20REALLY%20long%20running%20scripts.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-204453%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20run%20PnP%20PowerShell%20or%20CSOM%20PowerShell%20using%20Flow%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-204453%22%20slang%3D%22en-US%22%3EAgree%20with%20Pieter%20here%2C%20best%20option%20is%20to%20call%20an%20Azure%20Function%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-204375%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20run%20PnP%20PowerShell%20or%20CSOM%20PowerShell%20using%20Flow%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-204375%22%20slang%3D%22en-US%22%3E%3CP%3EMaybe%20a%20webservice%20and%20call%20it%20with%20an%20HTTP%20action.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-204344%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20run%20PnP%20PowerShell%20or%20CSOM%20PowerShell%20using%20Flow%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-204344%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20Pieter.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUnfortunately%2C%20I%20do%20not%20have%20access%20to%20Azure.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20another%20way%20of%20calling%20either%20PnP%20PowerShell%20or%20CSOM%20Powershell%20%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENigel%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-204340%22%20slang%3D%22en-US%22%3ERe%3A%20Can%20I%20run%20PnP%20PowerShell%20or%20CSOM%20PowerShell%20using%20Flow%20%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-204340%22%20slang%3D%22en-US%22%3E%3CP%3EHI%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F4102%22%20target%3D%22_blank%22%3E%40Nigel%20Price%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYes%20you%20can.%20Run%20the%20PnP%20PowerShell%26nbsp%3B%20in%20an%20Azure%20Function%20and%20then%20trigger%20the%20azure%20Function%20from%20flow.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Regular Contributor

Hi

 

I want Flow to kick off a PnP Powershell script.

 

This seems a pretty out of the box sort of thing to want to do.

 

Can I found anything on this ?

 

No

 

Anybody any ideas ?

 

Regards

 

Nigel

5 Replies
Highlighted

HI @Nigel Price,

 

Yes you can. Run the PnP PowerShell  in an Azure Function and then trigger the azure Function from flow.

Highlighted

Thanks Pieter.

 

Unfortunately, I do not have access to Azure.

 

Is there another way of calling either PnP PowerShell or CSOM Powershell ?

 

Regards

 

Nigel

Highlighted

Maybe a webservice and call it with an HTTP action.

Highlighted
Agree with Pieter here, best option is to call an Azure Function
Highlighted

Do do this I always use Azure Automation and call a Runbook from Flow.  Personally, I found that a lot simpler to get going with coming from an IT Pro background,  However, as others have said, I've also heard Azure Function work well.

 

If you have Office 365, you already have Azure to some extent for your Azure AD instance.

 

Also, Azure Automation is free for the first 500 minutes of running PowerShell/Runbooks, so even if you need to create an Azure tenant to do it, you won't have to spend a dime unless you have REALLY long running scripts.