external help file | Module Name | online version | schema |
---|---|---|---|
PSRule.Rules.Azure-help.xml |
PSRule.Rules.Azure |
2.0.0 |
Export policy assignment data.
Export-AzPolicyAssignmentData [-OutputPath <string>] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Export-AzPolicyAssignmentData [-Name <string>] [-Scope <string>] [-PolicyDefinitionId <string>] [-OutputPath <string>] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Export-AzPolicyAssignmentData -Id <string> [-PolicyDefinitionId <string>] [-OutputPath <string>] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
Export-AzPolicyAssignmentData -IncludeDescendent [-Scope <string>] [-OutputPath <string>] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
This is an experimental cmdlet.
Export policy assignment data.
By default the current subscription context will be exported. i.e Get-AzContext
Policy assignment data will be exported to the current working directory by default as JSON files, one per subscription.
All output files include a .assignment.json
extension by default.
Export-AzPolicyAssignmentData
Directory: C:\
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 26/03/2022 7:01 PM 740098 00000000-0000-0000-0000-000000000000.assignment.json
Export policy assignment data from current subscription context.
Export-AzPolicyAssignmentData -Name '000000000000000000000000' -Scope '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PolicyRG'
Directory: C:\
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 26/03/2022 7:15 PM 4185 00000000-0000-0000-0000-000000000000.assignment.json
Export policy assignment with specific name and scope.
Export-AzPolicyAssignmentData -Id '/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PolicyRG/providers/Microsoft.Authorization/policyAssignments/000000000000000000000000'
Directory: C:\
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 26/03/2022 7:42 PM 4185 00000000-0000-0000-0000-00000000000.assignment.json
Export policy assignment with specific resource ID.
Specifies the name of the policy assignment.
Type: String
Parameter Sets: (Name)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the fully qualified resource ID for the policy assignment.
Type: String
Parameter Sets: (Id)
Aliases: AssignmentId
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the scope at which the policy is applied for the assignment.
Type: String
Parameter Sets: (Name, IncludeDescendent)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Specifies the ID of the policy definition of the policy assignment.
Type: String
Parameter Sets: (Name, Id)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Causes the list of returned policy assignments to include all assignments related to the given scope, including those from ancestor scopes and those from descendent scopes.
Type: String
Parameter Sets: (IncludeDescendent)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
The path to store generated JSON files containing policy assignment data.
Type: String
Parameter Sets: Default
Aliases:
Required: True
Position: Named
Default value: $PWD
Accept pipeline input: False
Accept wildcard characters: False
By default, FileInfo objects are returned to the pipeline for each JSON file created.
When -PassThru
is specified, JSON files are not created and Azure resource objects are returned to
the pipeline instead.
Type: SwitchParameter
Parameter Sets: Default
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Return FileInfo
for each of the output files created, one per subscription context.
This is the default.
Return an object for each Azure resource, and configuration exported.
This is returned when the -PassThru
switch is used.