Edit

Share via


Remove-AzGalleryInVMAccessControlProfileVersionRulesRoleAssignment

Removes a Rules Role Assignment from a PSGalleryInVmAccessControlProfileVersion object.

Syntax

Default (Default)

Remove-AzGalleryInVMAccessControlProfileVersionRulesRoleAssignment

    -GalleryInVmAccessControlProfileVersion <PSGalleryInVMAccessControlProfileVersion>
    -Role <String>
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

The Remove-AzGalleryInVMAccessControlProfileVersionRulesRoleAssignment cmdlet removes a Rules Role Assignment from the provided PSGalleryInVmAccessControlProfileVersion object based on the role.

Examples

Example 1

$inVMAccessControlProfileVersion  = New-AzGalleryInVMAccessControlProfileVersionConfig -Name "myProfileVersion" -Location "West US 2" -Mode "Audit" -DefaultAccess "Deny" -TargetLocation @("West US 2")

Add-AzGalleryInVMAccessControlProfileVersionRulesRoleAssignment -GalleryInVmAccessControlProfileVersion $inVMAccessControlProfileVersion -Role "Provisioning" -Identity @("WinPA")
Add-AzGalleryInVMAccessControlProfileVersionRulesRoleAssignment -GalleryInVmAccessControlProfileVersion $inVMAccessControlProfileVersion -Role "Provisioning2" -Identity @("WinPA")

Remove-AzGalleryInVMAccessControlProfileVersionRulesRoleAssignment -GalleryInVmAccessControlProfileVersion $inVMAccessControlProfileVersion -Role "Provisioning2"

Creates a local PSGalleryInVMAccessControlProfileVersion object, add two rule role assignments, then remove the role assignment with role name "Provisioning2".

Parameters

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-GalleryInVmAccessControlProfileVersion

PSGalleryInVmAccessControlProfileVersion object created from New-AzGalleryInVMAccessControlProfileVersionConfig.

Parameter properties

Type:PSGalleryInVMAccessControlProfileVersion
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Role

The name of the role.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

PSGalleryInVMAccessControlProfileVersion

String

Outputs

PSGalleryInVMAccessControlProfileVersion