Skip to content

💡New command - Import-PnPFlow #4854

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

NishkalankBezawada
Copy link
Contributor

@NishkalankBezawada NishkalankBezawada commented Apr 15, 2025

Type

  • [] Bug Fix
  • New Feature
  • Sample

Related Issues?

Fixes #4816, partially fixes #Y, mentioned in #Z, etc.

What is in this Pull Request ?

New command to import a flow from a .zip package.

Import-PnPFlow

SYNTAX

Import-PnPFlow [-Environment <PowerAutomateEnvironmentPipeBind>] [-PackagePath <String>] [-Name <String>] [-Connection <PnPConnection>]
 

DESCRIPTION

This cmdlet Imports a Microsoft Power Automate Flow from a zip package.

Many times Importing a Microsoft Power Automate Flow will not be possible due to various reasons such as connections having gone stale, SharePoint sites referenced no longer existing or other configuration errors in the Flow. To display these errors when trying to Import a Flow, provide the -Verbose flag with your Import request. If not provided, these errors will silently be ignored.

EXAMPLES

Example 1

Import-PnPFlow -Environment (Get-PnPPowerPlatformEnvironment -Identity "myenvironment") -PackagePath C:\Temp\Export-ReEnableFlow_20250414140636.zip -Name NewFlowName

This will Import the specified Microsoft Power Automate Flow from the specified Power Platform environment as an output to the current output of PowerShell

Example 2

Import-PnPFlow -Environment (Get-PnPPowerPlatformEnvironment -IsDefault) -PackagePath C:\Temp\Export-ReEnableFlow_20250414140636.zip -Name NewFlowName

This will Import the specified Microsoft Power Automate Flow from the default Power Platform environment as an output to the current output of PowerShell

Example 3

Import-PnPFlow -PackagePath C:\Temp\Export-ReEnableFlow_20250414140636.zip -Name NewFlowName

This will Import a flow to the default environment. The flow will be imported as a zip package. The name of the flow will be set to NewFlowName.

Example 4

Import-PnPFlow -PackagePath C:\Temp\Export-ReEnableFlow_20250414140636.zip -Name NewFlowName -Verbose

This will Import a flow to the default environment. The flow will be imported as a zip package. The name of the flow will be set to NewFlowName. With the -Verbose flag, any errors that occur during the import process will be displayed in the console.

Test Screens

Screen 1

image

Screen 2

image

PARAMETERS

-Connection

Optional connection to be used by the cmdlet.
Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.

Type: PnPConnection
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Environment

The name of the Power Platform environment or an Environment instance. If omitted, the default environment will be used.

Type: PowerPlatformEnvironmentPipeBind
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: The default environment
Accept pipeline input: True
Accept wildcard characters: False

-PackagePath

Local path of the .zip package to import. The path must be a valid path on the local file system.

Type: String
Parameter Sets: (All)
Aliases:

Required: true
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Name

The new name of the flow.

Type: String
Parameter Sets: (All)
Aliases:

Required: true
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

Thanks,
Nish

@erwinvanhunen
Copy link
Member

Thank you! Can you please also add documentation for this cmdlet? Please create a corresponding .md file in the documents folder for that.

@NishkalankBezawada
Copy link
Contributor Author

Thank you! Can you please also add documentation for this cmdlet? Please create a corresponding .md file in the documents folder for that.

Hello @erwinvanhunen

I am still testing this, and need to make more refining, Would be finishing it soon.

Thanks,
Nish

@NishkalankBezawada NishkalankBezawada marked this pull request as ready for review April 30, 2025 16:47
@NishkalankBezawada NishkalankBezawada changed the title New command - Import-PnPFlow 💡New command - Import-PnPFlow Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Add or Copy Power Automate Flows
2 participants