|
| 1 | +--- |
| 2 | +Module Name: PnP.PowerShell |
| 3 | +schema: 2.0.0 |
| 4 | +applicable: SharePoint Online |
| 5 | +online version: https://pnp.github.io/powershell/cmdlets/Export-PnPPowerApp.html |
| 6 | +external help file: PnP.PowerShell.dll-Help.xml |
| 7 | +title: Export-PnPPowerApp |
| 8 | +--- |
| 9 | + |
| 10 | +# Export-PnPPowerApp |
| 11 | + |
| 12 | +## SYNOPSIS |
| 13 | + |
| 14 | +**Required Permissions** |
| 15 | + |
| 16 | +* Azure: management.azure.com |
| 17 | + |
| 18 | +Exports a Microsoft Power App |
| 19 | + |
| 20 | +## SYNTAX |
| 21 | + |
| 22 | +``` |
| 23 | +Export-PnPPowerApp -Environment <PowerPlatformEnvironmentPipeBind> -Identity <PowerAppPipeBind> |
| 24 | + [-PackageDisplayName <String>] [-PackageDescription <String>] [-PackageCreatedBy <String>] |
| 25 | + [-PackageSourceEnvironment <String>] [-OutPath <String>] [-Force] [-Connection <PnPConnection>] |
| 26 | + [<CommonParameters>] |
| 27 | +``` |
| 28 | + |
| 29 | +## DESCRIPTION |
| 30 | +This cmdlet exports a Microsoft Power App as zip package. |
| 31 | + |
| 32 | +Many times exporting a Microsoft Power App 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 App. To display these errors when trying to export a App, provide the -Verbose flag with your export request. If not provided, these errors will silently be ignored. |
| 33 | + |
| 34 | +## EXAMPLES |
| 35 | + |
| 36 | +### Example 1 |
| 37 | +```powershell |
| 38 | +$environment = Get-PnPPowerPlatformEnvironment -IsDefault $true |
| 39 | +Export-PnPPowerApp -Environment $environment -Identity fba63225-baf9-4d76-86a1-1b42c917a182 -OutPath "C:\Users\user1\Downloads\test_20230408152624.zip" |
| 40 | +``` |
| 41 | + |
| 42 | +This will export the specified Microsoft Power App from the default Power Platform environment as an output to the path specified in the command as -OutPath |
| 43 | + |
| 44 | +### Example 2 |
| 45 | +```powershell |
| 46 | +$environment = Get-PnPPowerPlatformEnvironment -IsDefault $true |
| 47 | +Export-PnPPowerApp -Environment $environment -Identity fba63225-baf9-4d76-86a1-1b42c917a182 -OutPath "C:\Users\user1\Downloads\test_20230408152624.zip" -PackageDisplayName "MyAppDisplayName" -PackageDescription "Package exported using PnP Powershell" -PackageCreatedBy "Siddharth Vaghasia" -PackageSourceEnvironment "UAT Environment" |
| 48 | +``` |
| 49 | +This will export the specified Microsoft Power App from the default Power Platform environment with metadata specified |
| 50 | + |
| 51 | +### Example 3 |
| 52 | +```powershell |
| 53 | +Get-PnPPowerPlatformEnvironment | foreach { Get-PnPPowerApp -Environment $_.Name } | foreach { Export-PnPPowerApp -Environment $_.Properties.EnvironmentDetails.Name -Identity $_ -OutPath "C:\Users\user1\Downloads\$($_.Name).zip" } |
| 54 | +``` |
| 55 | + |
| 56 | +This will export all the Microsoft Power Apps available within the tenant from all users from all the available Power Platform environments as a ZIP package for each of them to a local folder C:\Users\user1\Downloads |
| 57 | + |
| 58 | +## PARAMETERS |
| 59 | + |
| 60 | +### -Connection |
| 61 | +Optional connection to be used by the cmdlet. |
| 62 | +Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. |
| 63 | + |
| 64 | +```yaml |
| 65 | +Type: PnPConnection |
| 66 | +Parameter Sets: (All) |
| 67 | +Aliases: |
| 68 | + |
| 69 | +Required: False |
| 70 | +Position: Named |
| 71 | +Default value: None |
| 72 | +Accept pipeline input: False |
| 73 | +Accept wildcard characters: False |
| 74 | +``` |
| 75 | +
|
| 76 | +### -Environment |
| 77 | +The environment which contains the App. |
| 78 | +
|
| 79 | +```yaml |
| 80 | +Type: PowerPlatformEnvironmentPipeBind |
| 81 | +Parameter Sets: (All) |
| 82 | +Aliases: |
| 83 | + |
| 84 | +Required: True |
| 85 | +Position: Named |
| 86 | +Default value: None |
| 87 | +Accept pipeline input: False |
| 88 | +Accept wildcard characters: False |
| 89 | +``` |
| 90 | +
|
| 91 | +### -Identity |
| 92 | +The value of the Name property of a Microsoft Power App that you wish to export |
| 93 | +
|
| 94 | +```yaml |
| 95 | +Type: PowerAppPipeBind |
| 96 | +Parameter Sets: (All) |
| 97 | +Aliases: |
| 98 | + |
| 99 | +Required: True |
| 100 | +Position: Named |
| 101 | +Default value: None |
| 102 | +Accept pipeline input: False |
| 103 | +Accept wildcard characters: False |
| 104 | +``` |
| 105 | +
|
| 106 | +### -Force |
| 107 | +If specified and the file exported already exists it will be overwritten without confirmation. |
| 108 | +
|
| 109 | +```yaml |
| 110 | +Type: SwitchParameter |
| 111 | +Parameter Sets: (All) |
| 112 | +Aliases: |
| 113 | + |
| 114 | +Required: False |
| 115 | +Position: Named |
| 116 | +Default value: None |
| 117 | +Accept pipeline input: False |
| 118 | +Accept wildcard characters: False |
| 119 | +``` |
| 120 | +
|
| 121 | +### -OutPath |
| 122 | +Optional file name of the file to export to. If not provided, it will store the ZIP package to the current location from where the cmdlet is being run. |
| 123 | +
|
| 124 | +```yaml |
| 125 | +Type: String |
| 126 | +Parameter Sets: (All) |
| 127 | +Aliases: |
| 128 | + |
| 129 | +Required: False |
| 130 | +Position: Named |
| 131 | +Default value: None |
| 132 | +Accept pipeline input: False |
| 133 | +Accept wildcard characters: False |
| 134 | +``` |
| 135 | +
|
| 136 | +### -PackageCreatedBy |
| 137 | +The name of the person to be used as the creator of the exported package |
| 138 | +
|
| 139 | +```yaml |
| 140 | +Type: String |
| 141 | +Parameter Sets: (All) |
| 142 | +Aliases: |
| 143 | + |
| 144 | +Required: False |
| 145 | +Position: Named |
| 146 | +Default value: None |
| 147 | +Accept pipeline input: False |
| 148 | +Accept wildcard characters: False |
| 149 | +``` |
| 150 | +
|
| 151 | +### -PackageDescription |
| 152 | +The description to use in the exported package |
| 153 | +
|
| 154 | +```yaml |
| 155 | +Type: String |
| 156 | +Parameter Sets: (All) |
| 157 | +Aliases: |
| 158 | + |
| 159 | +Required: False |
| 160 | +Position: Named |
| 161 | +Default value: None |
| 162 | +Accept pipeline input: False |
| 163 | +Accept wildcard characters: False |
| 164 | +``` |
| 165 | +
|
| 166 | +### -PackageDisplayName |
| 167 | +The display name to use in the exported package |
| 168 | +
|
| 169 | +```yaml |
| 170 | +Type: String |
| 171 | +Parameter Sets: (All) |
| 172 | +Aliases: |
| 173 | + |
| 174 | +Required: False |
| 175 | +Position: Named |
| 176 | +Default value: None |
| 177 | +Accept pipeline input: False |
| 178 | +Accept wildcard characters: False |
| 179 | +``` |
| 180 | +
|
| 181 | +### -PackageSourceEnvironment |
| 182 | +The name of the source environment from which the exported package was taken |
| 183 | +
|
| 184 | +```yaml |
| 185 | +Type: String |
| 186 | +Parameter Sets: (All) |
| 187 | +Aliases: |
| 188 | + |
| 189 | +Required: False |
| 190 | +Position: Named |
| 191 | +Default value: None |
| 192 | +Accept pipeline input: False |
| 193 | +Accept wildcard characters: False |
| 194 | +``` |
| 195 | +
|
| 196 | +## RELATED LINKS |
| 197 | +
|
| 198 | +[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) |
0 commit comments