| external help file | PSRule.Rules.Azure-help.xml |
|---|---|
| Module Name | PSRule.Rules.Azure |
| online version | https://github.com/Azure/PSRule.Rules.Azure/blob/main/docs/commands/Export-AzPolicyAssignmentData.md |
| schema | 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 [-Scope <String>] [-IncludeDescendent] [-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-AzPolicyAssignmentDataDirectory: 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: FalseSpecifies 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: FalseSpecifies 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: FalseSpecifies 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: FalseCauses 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: SwitchParameter
Parameter Sets: IncludeDescendent
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe path to store generated JSON files containing policy assignment data.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: $PWD
Accept pipeline input: False
Accept wildcard characters: FalseBy 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: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis 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.