|
| 1 | +--- |
| 2 | +Module Name: PnP.PowerShell |
| 3 | +schema: 2.0.0 |
| 4 | +applicable: SharePoint Online |
| 5 | +online version: https://pnp.github.io/powershell/cmdlets/Import-PnPFlow.html |
| 6 | +external help file: PnP.PowerShell.dll-Help.xml |
| 7 | +title: Import-PnPFlow |
| 8 | +--- |
| 9 | + |
| 10 | +# Import-PnPFlow |
| 11 | + |
| 12 | +## SYNOPSIS |
| 13 | + |
| 14 | +**Required Permissions** |
| 15 | + |
| 16 | +* Azure: management.azure.com |
| 17 | + |
| 18 | +Imports a Microsoft Power Automate Flow. |
| 19 | + |
| 20 | +## SYNTAX |
| 21 | + |
| 22 | +### With Zip Package |
| 23 | +```powershell |
| 24 | +Import-PnPFlow [-Environment <PowerAutomateEnvironmentPipeBind>] [-PackagePath <String>] [-Name <String>] [-Connection <PnPConnection>] |
| 25 | + |
| 26 | +``` |
| 27 | + |
| 28 | +## DESCRIPTION |
| 29 | +This cmdlet imports a Microsoft Power Automate Flow from a ZIP package. At present, only flows originating from the same tenant are supported. |
| 30 | + |
| 31 | +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. |
| 32 | + |
| 33 | +## EXAMPLES |
| 34 | + |
| 35 | +### Example 1 |
| 36 | +```powershell |
| 37 | +Import-PnPFlow -Environment (Get-PnPPowerPlatformEnvironment -Identity "myenvironment") -PackagePath C:\Temp\Export-ReEnableFlow_20250414140636.zip -Name NewFlowName |
| 38 | +``` |
| 39 | + |
| 40 | +This will Import the specified Microsoft Power Automate Flow from the specified Power Platform environment as an output to the current output of PowerShell |
| 41 | + |
| 42 | +### Example 2 |
| 43 | +```powershell |
| 44 | +Import-PnPFlow -Environment (Get-PnPPowerPlatformEnvironment -IsDefault) -PackagePath C:\Temp\Export-ReEnableFlow_20250414140636.zip -Name NewFlowName |
| 45 | +``` |
| 46 | + |
| 47 | +This will Import the specified Microsoft Power Automate Flow from the default Power Platform environment as an output to the current output of PowerShell |
| 48 | + |
| 49 | +### Example 3 |
| 50 | +```powershell |
| 51 | +Import-PnPFlow -PackagePath C:\Temp\Export-ReEnableFlow_20250414140636.zip -Name NewFlowName |
| 52 | +``` |
| 53 | + |
| 54 | +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. |
| 55 | + |
| 56 | +### Example 4 |
| 57 | +```powershell |
| 58 | +Import-PnPFlow -PackagePath C:\Temp\Export-ReEnableFlow_20250414140636.zip -Name NewFlowName -Verbose |
| 59 | +``` |
| 60 | + |
| 61 | +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. |
| 62 | + |
| 63 | +## PARAMETERS |
| 64 | + |
| 65 | +### -Connection |
| 66 | +Optional connection to be used by the cmdlet. |
| 67 | +Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. |
| 68 | + |
| 69 | +```yaml |
| 70 | +Type: PnPConnection |
| 71 | +Parameter Sets: (All) |
| 72 | +Aliases: |
| 73 | + |
| 74 | +Required: False |
| 75 | +Position: Named |
| 76 | +Default value: None |
| 77 | +Accept pipeline input: False |
| 78 | +Accept wildcard characters: False |
| 79 | +``` |
| 80 | +
|
| 81 | +### -Environment |
| 82 | +The name of the Power Platform environment or an Environment instance. If omitted, the default environment will be used. |
| 83 | +
|
| 84 | +```yaml |
| 85 | +Type: PowerPlatformEnvironmentPipeBind |
| 86 | +Parameter Sets: (All) |
| 87 | +Aliases: |
| 88 | + |
| 89 | +Required: False |
| 90 | +Position: Named |
| 91 | +Default value: The default environment |
| 92 | +Accept pipeline input: True |
| 93 | +Accept wildcard characters: False |
| 94 | +``` |
| 95 | +
|
| 96 | +### -PackagePath |
| 97 | +Local path of the .zip package to import. The path must be a valid path on the local file system. |
| 98 | +
|
| 99 | +```yaml |
| 100 | +Type: String |
| 101 | +Parameter Sets: (All) |
| 102 | +Aliases: |
| 103 | + |
| 104 | +Required: true |
| 105 | +Position: Named |
| 106 | +Default value: None |
| 107 | +Accept pipeline input: False |
| 108 | +Accept wildcard characters: False |
| 109 | +``` |
| 110 | +
|
| 111 | +### -Name |
| 112 | +The new name of the flow. |
| 113 | +
|
| 114 | +```yaml |
| 115 | +Type: String |
| 116 | +Parameter Sets: (All) |
| 117 | +Aliases: |
| 118 | + |
| 119 | +Required: true |
| 120 | +Position: Named |
| 121 | +Default value: None |
| 122 | +Accept pipeline input: False |
| 123 | +Accept wildcard characters: False |
| 124 | +``` |
| 125 | +
|
| 126 | +## RELATED LINKS |
| 127 | +
|
| 128 | +[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) |
0 commit comments