Skip to content
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

New Commandlets : Add-PnPFlowOwner & Remove-PnPFlowOwner #3343

Merged
merged 6 commits into from
Sep 2, 2023

Conversation

NishkalankBezawada
Copy link
Contributor

Type

  • Bug Fix
  • New Feature
  • Sample

Related Issues?

Fixes #3335

What is in this Pull Request ?

Added to new commands
Add-PnPFlowOwner
Remove-PnPFlowOwner

Add-PnPFlowOwner

Assigns/updates permissions to a Power Automate flow

Syntax

Add-PnPFlowOwner [-Environment <PowerAutomateEnvironmentPipeBind>] [-Identity <PowerPlatformPipeBind>] [-User <String>] [-AsAdmin] [-RoleName <FlowUserRoleName>]

Example 1

$environment = Get-PnPPowerPlatformEnvironment
Add-PnPFlowOwner -environment $environment -Identity f07c34a9-a586-4e58-91fb-e7ea19741b61 -User username@tenant.onmicrosoft.com -RoleName CanEdit

Assigns the specified useremail with 'CanEdit' access level to the specified flow

Example 2

$environment = Get-PnPPowerPlatformEnvironment
Add-PnPFlowOwner -environment $environment -Identity f07c34a9-a586-4e58-91fb-e7ea19741b61 -User 6844c04a-8ee7-40ad-af66-28f6e948cd04 -RoleName CanView

Assigns the specified user id with 'CanView' access level to the specified flow

Example 3

$environment = Get-PnPPowerPlatformEnvironment
Add-PnPFlowOwner -environment $environment -Identity f07c34a9-a586-4e58-91fb-e7ea19741b61 -User 6844c04a-8ee7-40ad-af66-28f6e948cd04 -RoleName CanViewWithShare

Assigns the specified user id with 'CanViewWithShare' access level to the specified flow

Example 4

$environment = Get-PnPPowerPlatformEnvironment
Add-PnPFlowOwner -environment $environment -Identity f07c34a9-a586-4e58-91fb-e7ea19741b61 -User username@tenant.onmicrosoft.com -AsAdmin -RoleName CanEdit

Assigns the specified useremail with 'CanEdit' access level to the specified flow as admin

PARAMETERS

-Environment

The name of the Power Platform environment or an Environment object to retrieve the available flows for.

Type: PowerAutomateEnvironmentPipeBind
Parameter Sets: (All)
Aliases:

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

-Identity

The Name/Id of the flow to retrieve.

Type: PowerPlatformPipeBind
Parameter Sets: By Identity
Aliases:

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

-User

Returns the user with the provided user id or username.

Type: String
Parameter Sets: Return by specific ID/UserName

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

-RoleName

Allows specifying the type of access levels with which user should be added to the flow . Valid values: CanView, CanViewWithShare, CanEdit.

Type: FlowUserRoleName
Parameter Sets: All

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

-AsAdmin

If specified returns all the flows as admin. If not specified only the flows for the current user will be returned.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

Remove-PnPFlowOwner

Removes owner permissions to a Power Automate flow

Syntax

Remove-PnPFlowOwner [-Environment <PowerAutomateEnvironmentPipeBind>] [-Identity <PowerPlatformPipeBind>] [-User <String>] [-AsAdmin] [-Force]

Description

This cmdlet removes owner permissions for a user to a power automate flow.

Example 1

$environment = Get-PnPPowerPlatformEnvironment
Remove-PnPFlowOwner -environment $environment -Identity f07c34a9-a586-4e58-91fb-e7ea19741b61 -User username@tenant.onmicrosoft.com

Removes the specified user email with owner access level to the specified flow

Example 2

$environment = Get-PnPPowerPlatformEnvironment
Remove-PnPFlowOwner -environment $environment -Identity f07c34a9-a586-4e58-91fb-e7ea19741b61 -User 6844c04a-8ee7-40ad-af66-28f6e948cd04

Removes the specified user id with owner access level to the specified flow

Example 3

$environment = Get-PnPPowerPlatformEnvironment
Remove-PnPFlowOwner -environment $environment -Identity f07c34a9-a586-4e58-91fb-e7ea19741b61 -User username@tenant.onmicrosoft.com -AsAdmin

Removes the specified user email with owner access level to the specified flow as admin

Example 4

$environment = Get-PnPPowerPlatformEnvironment
Remove-PnPFlowOwner -environment $environment -Identity f07c34a9-a586-4e58-91fb-e7ea19741b61 -User username@tenant.onmicrosoft.com -AsAdmin -Force

Removes the specified user email with owner access level to the specified flow as admin, without confirmation

Parameters

-Environment

The name of the Power Platform environment or an Environment object to retrieve the available flows for.

Type: PowerAutomateEnvironmentPipeBind
Parameter Sets: (All)
Aliases:

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

-Identity

The Name/Id of the flow to retrieve.

Type: PowerPlatformPipeBind
Parameter Sets: By Identity
Aliases:

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

-User

Returns the user with the provided user id or username.

Type: String
Parameter Sets: Return by specific ID/UserName

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

-AsAdmin

If specified returns all the flows as admin. If not specified only the flows for the current user will be returned.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-Force

Specifying the Force parameter will skip the confirmation question.

Type: SwitchParameter
Parameter Sets: (All)

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

Summary

copilot:summary

Details

copilot:walkthrough

Thanks,
Nishkalank Bezawada

@KoenZomers
Copy link
Collaborator

Thanks for your contribution @NishkalankBezawada !

@KoenZomers KoenZomers merged commit ea8ba15 into pnp:dev Sep 2, 2023
3 checks passed
@NishkalankBezawada
Copy link
Contributor Author

Thanks for your contribution @NishkalankBezawada !

Thanks @KoenZomers

@NishkalankBezawada NishkalankBezawada deleted the Feature-3335 branch September 3, 2023 07:52
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 & Remove user as Flow Owner
2 participants