Microsoft Flow – use PowerShell to manage your flows

Microsoft Flow and PowerApps – Preview

Microsoft has released a preview version of PowerShell for PowerApps but actually you can use this PowerShell to manage your flows in general. It all starts by installing the PowerShell module as described in the earlier mentioned article. Please don’t forget to unblock the files that you downloaded otherwise your module will not load properly.

Get-Flow

The first Cmdlet that I’m interested in is Get-Flow

No current session is the message that you will get returned. It would be nice to see a Connect-… Cmdlet but in this module it is called Add-PowerAppsAccount. This is a bit of a shame as it feels like a missed opportunity to make PowerApps and Flow use the same connection command.

Anyway, the Add-PowerAppsAccount works and asks me for a login. Once connected, I  can get to my flows.

Now looking at all the exported commands available within the PowerShell module. We find a lot more options

 

PS C:\Temp\PowerAppsPowerShell> $module = (Get-Module Microsoft.PowerApps.PowerShell )

PS C:\Temp\PowerAppsPowerShell> $module.ExportedCommands

Add-PowerAppsAccount
BuildApprovalResponse
BuildFilterPattern
CreateAppObject
CreateAppRoleAssignmentObject
CreateApprovalObject
CreateApprovalRequestObject
CreateAppVersionObject
CreateConnectionObject
CreateConnectionRoleAssignmentObject
CreateConnectorObject
CreateConnectorRoleAssignmentObject
CreateEnvironmentObject
CreateFlowObject
CreateFlowRoleAssignmentObject
CreateFlowRunObject
CreateGroupObject
CreateHttpResponse
CreatePowerAppsNotificationObject
CreateTenantObject
CreateUserObject
Disable-Flow
Enable-Flow
Get-App
Get-AppRoleAssignment
Get-AppVersion
Get-AudienceForHostName
Get-Connection
Get-ConnectionRoleAssignment
Get-Connector
Get-ConnectorRoleAssignment
Get-FilteredEnvironments
Get-Flow
Get-FlowApproval
Get-FlowApprovalRequest
Get-FlowEnvironment
Get-FlowOwnerRole
Get-FlowRun
Get-JwtToken
Get-JwtTokenClaims
Get-PowerAppsEnvironment
Get-PowerAppsNotification
Get-TenantDetailsFromGraph
Get-UsersOrGroupsFromGraph
Invoke-OAuthDialog
Invoke-Request
InvokeApi
Publish-App
Remove-App
Remove-AppRoleAssignment
Remove-Connection
Remove-ConnectionRoleAssignment
Remove-Connector
Remove-ConnectorRoleAssignment
Remove-Flow
Remove-FlowOwnerRole
Remove-PowerAppsAccount
ReplaceMacro
ResolveEnvironment
RespondTo-FlowApprovalRequest
Restore-AppVersion
Select-CurrentEnvironment
Set-AppDisplayName
Set-AppRoleAssignment
Set-ConnectionRoleAssignment
Set-ConnectorRoleAssignment
Set-FlowOwnerRole
Test-PowerAppsAccount

We shouldn’t forget that this is only a preview version. Therefore it might be acceptable that the PowerShell naming standards for Cmdlets hasn’t been followed! This standard is Verb-Object and the verbs should come from the list of Verb given by Get-Verb.

Get-FlowRun also gives very limited information.

At this stage the PowerShell commands are your preview and it looks like all the commands that have been implemented are very technical and very limited. I’m looking forward to future versions as it will be great to be able to manage Microsoft Flow and PowerApps through PowerShell.

 

 

Advertisements

5 thoughts on “Microsoft Flow – use PowerShell to manage your flows

    1. Hi Marijn,
      flows are not really added to a library. Where in SharePoint Designer you would create a workflow to a library or list in SharePoint. Flow is completely not connected to SharePoint. In the flow that you create the first action is a trigger that starts your flow. This could be a trigger on a SharePoint list item or document.

      Liked by 1 person

      1. Thanks for your reply. We are dealing with project sites that are automatically created by powershell, having the option to also make specific flows available on those sites would be helpful. Now, people need to manually make them triggerable from a library.

        Like

      2. I haven’t been able to find any PowerShell that helps you create flows. Maybe using the Flow Management connector in Flow can help you. With that connector you can copy flows so you could trigger on a list item and then create a flow where you adjust the trigger details within the flow definition. Not sure how supported that would be though. Best option might be to add a uservoice to the flow community site.

        Like

  1. Nice to see some additions. Guess this will be fully announced at Builf this week.

    I may have missed it but a PowerShell command to manually trugger a flow would be good. Also a resubmit

    Good write up as usual. Thanks Pieter.

    Like

Please leave a comment or feedback

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.