Skip to content

Commit

Permalink
Merge pull request #4415 from reshmee011/restoreflow
Browse files Browse the repository at this point in the history
Add cmdlet Restore-PnPFlow
  • Loading branch information
KoenZomers authored Oct 11, 2024
2 parents b803fe2 + e2c962f commit dd23d32
Show file tree
Hide file tree
Showing 39 changed files with 381 additions and 315 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added `-Icon` and `-Color` parameters to `Set-PnPList` cmdlet. [#4409](https://github.com/pnp/powershell/pull/4409)
- Added `Remove-PnPTenantRestrictedSearchAllowedList` cmdlet to removes site URLs from the allowed list when Restricted SharePoint Search is enabled. [#4399](https://github.com/pnp/powershell/pull/4399)
- Added `Get-PnPDeletedFlow` cmdlet to retrieve a list of flows which are soft deleted. [#4396](https://github.com/pnp/powershell/pull/4396)
- Added `Restore-PnPFlow` cmdlet which allows for undeleting a flow within 21 days of deletion. [#4415](https://github.com/pnp/powershell/pull/4415)
- Added `-ExcludeDeprecated` to `Export-PnpTaxonomy` which allows for deprecated terms to be excluded from the export [#4053](https://github.com/pnp/powershell/pull/4053)

### Changed
Expand All @@ -44,6 +45,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- `Remove-PnPContentType` and `Remove-PnPContentTypeFromList` now use PnP Core SDK for processing requests. [#4390](https://github.com/pnp/powershell/pull/4390)
- `Clear-PnPRecycleBinItem` , `Move-PnPRecycleBinItem` and `Restore-PnPRecycleBinItem` cmdlets now use PnP Core SDK for processing requests. [#4393](https://github.com/pnp/powershell/pull/4393/)
- `Get-PnPSearchCrawlLog` cmdlet now shows a warning in case application permissions are used. [#4391](https://github.com/pnp/powershell/pull/4391)
- All Power Platform cmdlets no longer require an environment to be specified. If omitted, the default environment will be retrieved and used. [#4415](https://github.com/pnp/powershell/pull/4415)

### Fixed

Expand Down
28 changes: 14 additions & 14 deletions documentation/Add-PnPFlowOwner.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Assigns/updates permissions to a Power Automate flow
## SYNTAX

```powershell
Add-PnPFlowOwner -Environment <PowerAutomateEnvironmentPipeBind> -Identity <PowerPlatformPipeBind> -User <String> -Role <FlowAccessRole> [-AsAdmin] [-Verbose]
Add-PnPFlowOwner [-Environment <PowerAutomateEnvironmentPipeBind>] -Identity <PowerPlatformPipeBind> -User <String> -Role <FlowAccessRole> [-AsAdmin] [-Verbose]
```

## DESCRIPTION
Expand All @@ -30,42 +30,42 @@ This cmdlet assigns/updates permissions for a user to a Power Automate flow.

### Example 1
```powershell
Add-PnPFlowOwner -Environment (Get-PnPPowerPlatformEnvironment -IsDefault) -Identity f07c34a9-a586-4e58-91fb-e7ea19741b61 -User [email protected] -Role CanEdit
Add-PnPFlowOwner -Identity f07c34a9-a586-4e58-91fb-e7ea19741b61 -User [email protected] -Role CanEdit
```
Assigns the specified user with 'CanEdit' access level to the specified flow
Assigns the specified user with 'CanEdit' access level to the specified flow in the default environment

### Example 2
```powershell
Add-PnPFlowOwner -Environment (Get-PnPPowerPlatformEnvironment -IsDefault) -Identity f07c34a9-a586-4e58-91fb-e7ea19741b61 -User 6844c04a-8ee7-40ad-af66-28f6e948cd04 -Role CanView
Add-PnPFlowOwner -Identity f07c34a9-a586-4e58-91fb-e7ea19741b61 -User 6844c04a-8ee7-40ad-af66-28f6e948cd04 -Role CanView
```
Assigns the specified user with 'CanView' access level to the specified flow
Assigns the specified user with 'CanView' access level to the specified flow in the default environment

### Example 3
```powershell
Add-PnPFlowOwner -Environment (Get-PnPPowerPlatformEnvironment -IsDefault) -Identity f07c34a9-a586-4e58-91fb-e7ea19741b61 -User 6844c04a-8ee7-40ad-af66-28f6e948cd04 -Role CanViewWithShare
Add-PnPFlowOwner -Environment (Get-PnPPowerPlatformEnvironment -Identity "myenvironment") -Identity f07c34a9-a586-4e58-91fb-e7ea19741b61 -User 6844c04a-8ee7-40ad-af66-28f6e948cd04 -Role CanViewWithShare
```
Assigns the specified user with 'CanViewWithShare' access level to the specified flow
Assigns the specified user with 'CanViewWithShare' access level to the specified flow in the specified environment

### Example 4
```powershell
Add-PnPFlowOwner -Environment (Get-PnPPowerPlatformEnvironment -IsDefault) -Identity f07c34a9-a586-4e58-91fb-e7ea19741b61 -User [email protected] -AsAdmin -Role CanEdit
Add-PnPFlowOwner -Environment (Get-PnPPowerPlatformEnvironment -Identity "myenvironment") -Identity f07c34a9-a586-4e58-91fb-e7ea19741b61 -User [email protected] -AsAdmin -Role CanEdit
```
Assigns the specified user with 'CanEdit' access level to the specified flow as admin
Assigns the specified user with 'CanEdit' access level to the specified flow as admin in the specified environment

## PARAMETERS

### -Environment
The Power Platform environment that hosts the Power Automate Flow to add the permissions to.
The name of the Power Platform environment or an Environment instance. If omitted, the default environment will be used.

```yaml
Type: PowerAutomateEnvironmentPipeBind
Type: PowerPlatformEnvironmentPipeBind
Parameter Sets: (All)
Aliases:

Required: True
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Default value: The default environment
Accept pipeline input: True
Accept wildcard characters: False
```
Expand Down
24 changes: 15 additions & 9 deletions documentation/Disable-PnPFlow.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Disables a specific flow
## SYNTAX

```powershell
Disable-PnPFlow -Environment <PowerAutomateEnvironmentPipeBind> -Identity <PowerAutomateFlowPipeBind> [-AsAdmin] [-Connection <PnPConnection>]
Disable-PnPFlow [-Environment <PowerAutomateEnvironmentPipeBind>] -Identity <PowerAutomateFlowPipeBind> [-AsAdmin] [-Connection <PnPConnection>]
```

## DESCRIPTION
Expand All @@ -30,11 +30,17 @@ This cmdlet disables a specific flow

### Example 1
```powershell
$environment = Get-PnPFlowEnvironment
Disable-PnPFlow -Environment $environment -Identity fba63225-baf9-4d76-86a1-1b42c917a182
Disable-PnPFlow -Identity fba63225-baf9-4d76-86a1-1b42c917a182
```

Disables the specified flow.
Disables the specified flow in the default environment

### Example 2
```powershell
Disable-PnPFlow -Environment (Get-PnPPowerPlatformEnvironment -Identity "myenvironment") -Identity fba63225-baf9-4d76-86a1-1b42c917a182
```

Disables the specified flow in the specified environment

## PARAMETERS

Expand Down Expand Up @@ -70,17 +76,17 @@ Accept wildcard characters: False
```
### -Environment
The name of the environment or an Environment object to retrieve the available flows for.
The name of the Power Platform environment or an Environment instance. If omitted, the default environment will be used.
```yaml
Type: PowerAutomateEnvironmentPipeBind
Type: PowerPlatformEnvironmentPipeBind
Parameter Sets: (All)
Aliases:

Required: True
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Default value: The default environment
Accept pipeline input: True
Accept wildcard characters: False
```
Expand Down
24 changes: 15 additions & 9 deletions documentation/Enable-PnPFlow.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Enables a specific flow
## SYNTAX

```powershell
Enable-PnPFlow -Environment <PowerAutomateEnvironmentPipeBind> -Identity <PowerAutomateFlowPipeBind> [-AsAdmin]
Enable-PnPFlow [-Environment <PowerAutomateEnvironmentPipeBind>] -Identity <PowerAutomateFlowPipeBind> [-AsAdmin]
[-Connection <PnPConnection>]
```

Expand All @@ -31,26 +31,32 @@ This cmdlet enables a specific flow

### Example 1
```powershell
$environment = Get-PnPFlowEnvironment
Enable-PnPFlow -Environment $environment -Identity fba63225-baf9-4d76-86a1-1b42c917a182
Enable-PnPFlow -Identity fba63225-baf9-4d76-86a1-1b42c917a182
```

Enables the specified flow
Enables the specified flow in the default environment

### Example 2
```powershell
Enable-PnPFlow -Environment (Get-PnPPowerPlatformEnvironment -Identity "myenvironment") -Identity fba63225-baf9-4d76-86a1-1b42c917a182
```

Enables the specified flow in the specified environment

## PARAMETERS

### -Environment
The name of the environment or an Environment object to retrieve the available flows for.
The name of the Power Platform environment or an Environment instance. If omitted, the default environment will be used.

```yaml
Type: PowerAutomateEnvironmentPipeBind
Type: PowerPlatformEnvironmentPipeBind
Parameter Sets: (All)
Aliases:

Required: True
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Default value: The default environment
Accept pipeline input: True
Accept wildcard characters: False
```
Expand Down
26 changes: 16 additions & 10 deletions documentation/Export-PnPFlow.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ Exports a Microsoft Power Automate Flow

### As ZIP Package
```powershell
Export-PnPFlow -Environment <PowerAutomateEnvironmentPipeBind> -Identity <PowerAutomateFlowPipeBind>
Export-PnPFlow [-Environment <PowerAutomateEnvironmentPipeBind>] -Identity <PowerAutomateFlowPipeBind>
[-AsZipPackage] [-PackageDisplayName <String>] [-PackageDescription <String>] [-PackageCreatedBy <String>]
[-PackageSourceEnvironment <String>] [-OutPath <String>] [-Force] [-Connection <PnPConnection>]
```

### As Json
```powershell
Export-PnPFlow -Environment <PowerAutomateEnvironmentPipeBind> -Identity <PowerAutomateFlowPipeBind>
Export-PnPFlow [-Environment <PowerAutomateEnvironmentPipeBind>] -Identity <PowerAutomateFlowPipeBind>
[-Connection <PnPConnection>]
```

Expand All @@ -42,14 +42,20 @@ Many times exporting a Microsoft Power Automate Flow will not be possible due to

### Example 1
```powershell
$environment = Get-PnPPowerPlatformEnvironment -IsDefault $true
Export-PnPFlow -Environment $environment -Identity fba63225-baf9-4d76-86a1-1b42c917a182
Export-PnPFlow -Environment (Get-PnPPowerPlatformEnvironment -Identity "myenvironment") -Identity fba63225-baf9-4d76-86a1-1b42c917a182
```

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

### Example 2
```powershell
Export-PnPFlow -Environment (Get-PnPPowerPlatformEnvironment -IsDefault) -Identity fba63225-baf9-4d76-86a1-1b42c917a182
```

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

### Example 3
```powershell
Get-PnPPowerPlatformEnvironment | foreach { Get-PnPFlow -Environment $_.Name } | foreach { Export-PnPFlow -Environment $_.Properties.EnvironmentDetails.Name -Identity $_ -OutPath "c:\flows\$($_.Name).zip" -AsZipPackage }
```

Expand Down Expand Up @@ -89,17 +95,17 @@ Accept wildcard characters: False
```
### -Environment
The environment which contains the flow.
The name of the Power Platform environment or an Environment instance. If omitted, the default environment will be used.
```yaml
Type: PowerAutomateEnvironmentPipeBind
Type: PowerPlatformEnvironmentPipeBind
Parameter Sets: (All)
Aliases:

Required: True
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Default value: The default environment
Accept pipeline input: True
Accept wildcard characters: False
```
Expand Down
18 changes: 8 additions & 10 deletions documentation/Export-PnPPowerApp.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Exports a Microsoft Power App
## SYNTAX

```
Export-PnPPowerApp -Environment <PowerPlatformEnvironmentPipeBind> -Identity <PowerAppPipeBind>
Export-PnPPowerApp [-Environment <PowerPlatformEnvironmentPipeBind>] -Identity <PowerAppPipeBind>
[-PackageDisplayName <String>] [-PackageDescription <String>] [-PackageCreatedBy <String>]
[-PackageSourceEnvironment <String>] [-OutPath <String>] [-Force] [-Connection <PnPConnection>]
[<CommonParameters>]
Expand All @@ -35,18 +35,16 @@ Many times exporting a Microsoft Power App will not be possible due to various r

### Example 1
```powershell
$environment = Get-PnPPowerPlatformEnvironment -IsDefault $true
Export-PnPPowerApp -Environment $environment -Identity fba63225-baf9-4d76-86a1-1b42c917a182 -OutPath "C:\Users\user1\Downloads\test_20230408152624.zip"
Export-PnPPowerApp -Identity fba63225-baf9-4d76-86a1-1b42c917a182 -OutPath "C:\Users\user1\Downloads\test_20230408152624.zip"
```

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

### Example 2
```powershell
$environment = Get-PnPPowerPlatformEnvironment -IsDefault $true
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"
Export-PnPPowerApp -Environment (Get-PnPPowerPlatformEnvironment -Identity "myenvironment") -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"
```
This will export the specified Microsoft Power App from the default Power Platform environment with metadata specified
This will export the specified Microsoft Power App from the specified Power Platform environment with metadata specified

### Example 3
```powershell
Expand Down Expand Up @@ -74,17 +72,17 @@ Accept wildcard characters: False
```
### -Environment
The environment which contains the App.
The name of the Power Platform environment or an Environment instance. If omitted, the default environment will be used.
```yaml
Type: PowerPlatformEnvironmentPipeBind
Parameter Sets: (All)
Aliases:

Required: True
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Default value: The default environment
Accept pipeline input: True
Accept wildcard characters: False
```
Expand Down
7 changes: 3 additions & 4 deletions documentation/Get-PnPDeletedFlow.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,20 @@ Returns all the deleted flows for a given Power Platform environment belonging
## PARAMETERS

### -Environment
The name of the Power Platform environment or an Environment object to retrieve the available flows for.
The name of the Power Platform environment or an Environment instance. If omitted, the default environment will be used.

```yaml
Type: PowerAutomateEnvironmentPipeBind
Type: PowerPlatformEnvironmentPipeBind
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: The default environment
Accept pipeline input: False
Accept pipeline input: True
Accept wildcard characters: False
```
### -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.
Expand Down
6 changes: 3 additions & 3 deletions documentation/Get-PnPFlow.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,17 @@ Returns a specific flow from the default Power Platform environment
## PARAMETERS

### -Environment
The name of the Power Platform environment or an Environment object to retrieve the available flows for.
The name of the Power Platform environment or an Environment instance. If omitted, the default environment will be used.

```yaml
Type: PowerAutomateEnvironmentPipeBind
Type: PowerPlatformEnvironmentPipeBind
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: The default environment
Accept pipeline input: False
Accept pipeline input: True
Accept wildcard characters: False
```
Expand Down
20 changes: 13 additions & 7 deletions documentation/Get-PnPFlowOwner.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Returns the owners of a Power Automate flow
## SYNTAX

```powershell
Get-PnPFlowOwner -Environment <PowerAutomateEnvironmentPipeBind> -Identity <PowerAutomateFlowPipeBind> [-AsAdmin]
Get-PnPFlowOwner [-Environment <PowerAutomateEnvironmentPipeBind>] -Identity <PowerAutomateFlowPipeBind> [-AsAdmin]
```

## DESCRIPTION
Expand All @@ -30,24 +30,30 @@ This cmdlet returns the Power Automate flow owners for a given Power Automate Fl

### Example 1
```powershell
Get-PnPFlowOwner -Environment (Get-PnPPowerPlatformEnvironment -IsDefault) -Identity 33f78dac-7e93-45de-ab85-67cad0f6ee30
Get-PnPFlowOwner -Identity 33f78dac-7e93-45de-ab85-67cad0f6ee30
```
Returns all the owners of the Power Automate Flow with the provided identifier on the default Power Platform environment

### Example 2
```powershell
Get-PnPFlowOwner -Environment (Get-PnPPowerPlatformEnvironment -Identity "myenvironment") -Identity 33f78dac-7e93-45de-ab85-67cad0f6ee30
```
Returns all the owners of the Power Automate Flow with the provided identifier on the specified Power Platform environment

## PARAMETERS

### -Environment
The Power Platform environment that hosts the Power Automate Flow to retrieve the owners of.
The name of the Power Platform environment or an Environment instance. If omitted, the default environment will be used.

```yaml
Type: PowerAutomateEnvironmentPipeBind
Type: PowerPlatformEnvironmentPipeBind
Parameter Sets: (All)
Aliases:

Required: True
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Default value: The default environment
Accept pipeline input: True
Accept wildcard characters: False
```
Expand Down
Loading

0 comments on commit dd23d32

Please sign in to comment.