diff --git a/.azure-pipelines/code-gen.yml b/.azure-pipelines/code-gen.yml
index fdc50644c1a9..b00c6008fe8f 100644
--- a/.azure-pipelines/code-gen.yml
+++ b/.azure-pipelines/code-gen.yml
@@ -94,6 +94,7 @@ jobs:
git remote set-url origin https://azure-powershell-bot:$(GithubToken)@github.com/Azure/azure-powershell.git;
git push origin codegen/${{ parameters.ServiceName }} --force;
arguments: '-RequiredPsVersion $(PSVersion)'
+ pwsh: true
- pwsh: |
$SourceBranch = "$(Build.SourceBranch)"
$SourceBranch = $SourceBranch.Replace("refs/heads/", "")
diff --git a/src/Resources/ResourceManager/Implementation/Policy/GetAzurePolicyAssignment.cs b/src/Resources/ResourceManager/Implementation/Policy/GetAzurePolicyAssignment.cs
index 5dade71769bf..c7379348119a 100644
--- a/src/Resources/ResourceManager/Implementation/Policy/GetAzurePolicyAssignment.cs
+++ b/src/Resources/ResourceManager/Implementation/Policy/GetAzurePolicyAssignment.cs
@@ -27,6 +27,9 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
///
/// Gets the policy assignment.
///
+ [CmdletOutputBreakingChangeWithVersion(
+ typeof(PsPolicyAssignment), deprecateByAzVersion: "11.0.0", deprecateByVersion: "7.0.0", DeprecatedOutputProperties = new[] { "Properties" },
+ NewOutputProperties = new[] { "Description", "DisplayName", "EnforcementMode", "Metadata", "NonComplianceMessages", "NotScopes", "Parameters", "PolicyDefinitionId", "Scope" })]
[Cmdlet(VerbsCommon.Get, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "PolicyAssignment", DefaultParameterSetName = PolicyCmdletBase.DefaultParameterSet), OutputType(typeof(PsPolicyAssignment))]
public class GetAzurePolicyAssignmentCmdlet : PolicyCmdletBase
{
diff --git a/src/Resources/ResourceManager/Implementation/Policy/GetAzurePolicyDefinition.cs b/src/Resources/ResourceManager/Implementation/Policy/GetAzurePolicyDefinition.cs
index 518b001faa77..fddfb5d5a1b1 100644
--- a/src/Resources/ResourceManager/Implementation/Policy/GetAzurePolicyDefinition.cs
+++ b/src/Resources/ResourceManager/Implementation/Policy/GetAzurePolicyDefinition.cs
@@ -29,6 +29,9 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
///
/// Gets the policy definition.
///
+ [CmdletOutputBreakingChangeWithVersion(
+ typeof(PsPolicyDefinition), deprecateByAzVersion: "11.0.0", deprecateByVersion: "7.0.0", DeprecatedOutputProperties = new[] { "Properties" },
+ NewOutputProperties = new[] { "Description", "DisplayName", "Metadata", "Mode", "Parameters", "PolicyRule", "PolicyType" })]
[Cmdlet(VerbsCommon.Get, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "PolicyDefinition", DefaultParameterSetName = PolicyCmdletBase.NameParameterSet), OutputType(typeof(PsPolicyDefinition))]
public class GetAzurePolicyDefinitionCmdlet : PolicyCmdletBase
{
diff --git a/src/Resources/ResourceManager/Implementation/Policy/GetAzurePolicyExemption.cs b/src/Resources/ResourceManager/Implementation/Policy/GetAzurePolicyExemption.cs
index 3b7bcc0b49b5..a315c1bd2631 100644
--- a/src/Resources/ResourceManager/Implementation/Policy/GetAzurePolicyExemption.cs
+++ b/src/Resources/ResourceManager/Implementation/Policy/GetAzurePolicyExemption.cs
@@ -27,6 +27,9 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
///
/// Gets the policy exemption.
///
+ [CmdletOutputBreakingChangeWithVersion(
+ typeof(PsPolicyExemption), deprecateByAzVersion: "11.0.0", deprecateByVersion: "7.0.0", DeprecatedOutputProperties = new[] { "Properties" },
+ NewOutputProperties = new[] { "Description", "DisplayName", "ExemptionCategory", "ExpiresOn", "Metadata", "PolicyAssignmentId", "PolicyDefinitionReferenceIds" })]
[Cmdlet(VerbsCommon.Get, AzureRMConstants.AzureRMPrefix + "PolicyExemption", DefaultParameterSetName = PolicyCmdletBase.NameParameterSet), OutputType(typeof(PsPolicyExemption))]
public class GetAzurePolicyExemptionCmdlet : PolicyCmdletBase
{
diff --git a/src/Resources/ResourceManager/Implementation/Policy/GetAzurePolicySetDefinition.cs b/src/Resources/ResourceManager/Implementation/Policy/GetAzurePolicySetDefinition.cs
index 7a82e7c87b64..086ddee38b8f 100644
--- a/src/Resources/ResourceManager/Implementation/Policy/GetAzurePolicySetDefinition.cs
+++ b/src/Resources/ResourceManager/Implementation/Policy/GetAzurePolicySetDefinition.cs
@@ -29,6 +29,9 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
///
/// Gets the policy set definition.
///
+ [CmdletOutputBreakingChangeWithVersion(
+ typeof(PsPolicySetDefinition), deprecateByAzVersion: "11.0.0", deprecateByVersion: "7.0.0", DeprecatedOutputProperties = new[] { "Properties" },
+ NewOutputProperties = new[] { "Description", "DisplayName", "Metadata", "Parameters", "PolicyDefinitionGroups", "PolicyDefinitions", "PolicyType" })]
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "PolicySetDefinition", DefaultParameterSetName = PolicyCmdletBase.NameParameterSet), OutputType(typeof(PsPolicySetDefinition))]
public class GetAzurePolicySetDefinitionCmdlet : PolicyCmdletBase
{
diff --git a/src/Resources/ResourceManager/Implementation/Policy/NewAzurePolicyAssignment.cs b/src/Resources/ResourceManager/Implementation/Policy/NewAzurePolicyAssignment.cs
index de2e9c93db5b..cfbae95473ae 100644
--- a/src/Resources/ResourceManager/Implementation/Policy/NewAzurePolicyAssignment.cs
+++ b/src/Resources/ResourceManager/Implementation/Policy/NewAzurePolicyAssignment.cs
@@ -34,6 +34,9 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
///
/// Creates a policy assignment.
///
+ [CmdletOutputBreakingChangeWithVersion(
+ typeof(PsPolicyAssignment), deprecateByAzVersion: "11.0.0", deprecateByVersion: "7.0.0", DeprecatedOutputProperties = new[] { "Properties" },
+ NewOutputProperties = new[] { "Description", "DisplayName", "EnforcementMode", "Metadata", "NonComplianceMessages", "NotScopes", "Parameters", "PolicyDefinitionId", "Scope" })]
[Cmdlet(VerbsCommon.New, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "PolicyAssignment", DefaultParameterSetName = PolicyCmdletBase.DefaultParameterSet), OutputType(typeof(PsPolicyAssignment))]
public class NewAzurePolicyAssignmentCmdlet : PolicyCmdletBase, IDynamicParameters
{
diff --git a/src/Resources/ResourceManager/Implementation/Policy/NewAzurePolicyDefinition.cs b/src/Resources/ResourceManager/Implementation/Policy/NewAzurePolicyDefinition.cs
index f7424c56ff50..630e13234b68 100644
--- a/src/Resources/ResourceManager/Implementation/Policy/NewAzurePolicyDefinition.cs
+++ b/src/Resources/ResourceManager/Implementation/Policy/NewAzurePolicyDefinition.cs
@@ -28,6 +28,9 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
///
/// Creates the new policy definition.
///
+ [CmdletOutputBreakingChangeWithVersion(
+ typeof(PsPolicyDefinition), deprecateByAzVersion: "11.0.0", deprecateByVersion: "7.0.0", DeprecatedOutputProperties = new[] { "Properties" },
+ NewOutputProperties = new[] { "Description", "DisplayName", "Metadata", "Mode", "Parameters", "PolicyRule", "PolicyType" })]
[Cmdlet(VerbsCommon.New, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "PolicyDefinition", DefaultParameterSetName = PolicyCmdletBase.NameParameterSet), OutputType(typeof(PsPolicyDefinition))]
public class NewAzurePolicyDefinitionCmdlet : PolicyCmdletBase
{
diff --git a/src/Resources/ResourceManager/Implementation/Policy/NewAzurePolicyExemption.cs b/src/Resources/ResourceManager/Implementation/Policy/NewAzurePolicyExemption.cs
index 7222483709f8..11b5ba2df831 100644
--- a/src/Resources/ResourceManager/Implementation/Policy/NewAzurePolicyExemption.cs
+++ b/src/Resources/ResourceManager/Implementation/Policy/NewAzurePolicyExemption.cs
@@ -29,6 +29,9 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
///
/// Creates a policy exemption.
///
+ [CmdletOutputBreakingChangeWithVersion(
+ typeof(PsPolicyExemption), deprecateByAzVersion: "11.0.0", deprecateByVersion: "7.0.0", DeprecatedOutputProperties = new[] { "Properties" },
+ NewOutputProperties = new[] { "Description", "DisplayName", "ExemptionCategory", "ExpiresOn", "Metadata", "PolicyAssignmentId", "PolicyDefinitionReferenceIds" })]
[Cmdlet(VerbsCommon.New, AzureRMConstants.AzureRMPrefix + "PolicyExemption", DefaultParameterSetName = PolicyCmdletBase.DefaultParameterSet, SupportsShouldProcess = true), OutputType(typeof(PsPolicyExemption))]
public class NewAzurePolicyExemptionCmdlet : PolicyCmdletBase
{
diff --git a/src/Resources/ResourceManager/Implementation/Policy/NewAzurePolicySetDefinition.cs b/src/Resources/ResourceManager/Implementation/Policy/NewAzurePolicySetDefinition.cs
index 3c00b5933028..1aca1a7fb3bc 100644
--- a/src/Resources/ResourceManager/Implementation/Policy/NewAzurePolicySetDefinition.cs
+++ b/src/Resources/ResourceManager/Implementation/Policy/NewAzurePolicySetDefinition.cs
@@ -27,6 +27,9 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
///
/// Creates the policy set definition.
///
+ [CmdletOutputBreakingChangeWithVersion(
+ typeof(PsPolicySetDefinition), deprecateByAzVersion: "11.0.0", deprecateByVersion: "7.0.0", DeprecatedOutputProperties = new[] { "Properties" },
+ NewOutputProperties = new[] { "Description", "DisplayName", "Metadata", "Parameters", "PolicyDefinitionGroups", "PolicyDefinitions", "PolicyType" })]
[Cmdlet(VerbsCommon.New, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "PolicySetDefinition", DefaultParameterSetName = PolicyCmdletBase.NameParameterSet, SupportsShouldProcess = true), OutputType(typeof(PsPolicySetDefinition))]
public class NewAzurePolicySetDefinitionCmdlet : PolicyCmdletBase
{
diff --git a/src/Resources/ResourceManager/Implementation/Policy/SetAzurePolicyAssignment.cs b/src/Resources/ResourceManager/Implementation/Policy/SetAzurePolicyAssignment.cs
index 8e91da5940d3..79592d096f8d 100644
--- a/src/Resources/ResourceManager/Implementation/Policy/SetAzurePolicyAssignment.cs
+++ b/src/Resources/ResourceManager/Implementation/Policy/SetAzurePolicyAssignment.cs
@@ -32,6 +32,9 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
///
/// Sets the policy assignment.
///
+ [CmdletOutputBreakingChangeWithVersion(
+ typeof(PsPolicyAssignment), deprecateByAzVersion: "11.0.0", deprecateByVersion: "7.0.0", DeprecatedOutputProperties = new[] { "Properties" },
+ NewOutputProperties = new[] { "Description", "DisplayName", "EnforcementMode", "Metadata", "NonComplianceMessages", "NotScopes", "Parameters", "PolicyDefinitionId", "Scope" })]
[Cmdlet(VerbsCommon.Set, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "PolicyAssignment", DefaultParameterSetName = PolicyCmdletBase.NameParameterSet), OutputType(typeof(PsPolicyAssignment))]
public class SetAzurePolicyAssignmentCmdlet : PolicyCmdletBase
{
diff --git a/src/Resources/ResourceManager/Implementation/Policy/SetAzurePolicyDefinition.cs b/src/Resources/ResourceManager/Implementation/Policy/SetAzurePolicyDefinition.cs
index d821a3d5f78e..60b6928995ed 100644
--- a/src/Resources/ResourceManager/Implementation/Policy/SetAzurePolicyDefinition.cs
+++ b/src/Resources/ResourceManager/Implementation/Policy/SetAzurePolicyDefinition.cs
@@ -28,6 +28,9 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
///
/// Sets the policy definition.
///
+ [CmdletOutputBreakingChangeWithVersion(
+ typeof(PsPolicyDefinition), deprecateByAzVersion: "11.0.0", deprecateByVersion: "7.0.0", DeprecatedOutputProperties = new[] { "Properties" },
+ NewOutputProperties = new[] { "Description", "DisplayName", "Metadata", "Mode", "Parameters", "PolicyRule", "PolicyType" })]
[Cmdlet(VerbsCommon.Set, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "PolicyDefinition", DefaultParameterSetName = PolicyCmdletBase.NameParameterSet), OutputType(typeof(PsPolicyDefinition))]
public class SetAzurePolicyDefinitionCmdlet : PolicyCmdletBase
{
diff --git a/src/Resources/ResourceManager/Implementation/Policy/SetAzurePolicyExemption.cs b/src/Resources/ResourceManager/Implementation/Policy/SetAzurePolicyExemption.cs
index 1b9aa4379468..f51f6ad876f3 100644
--- a/src/Resources/ResourceManager/Implementation/Policy/SetAzurePolicyExemption.cs
+++ b/src/Resources/ResourceManager/Implementation/Policy/SetAzurePolicyExemption.cs
@@ -28,6 +28,9 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
///
/// Sets the policy exemption.
///
+ [CmdletOutputBreakingChangeWithVersion(
+ typeof(PsPolicyExemption), deprecateByAzVersion: "11.0.0", deprecateByVersion: "7.0.0", DeprecatedOutputProperties = new[] { "Properties" },
+ NewOutputProperties = new[] { "Description", "DisplayName", "ExemptionCategory", "ExpiresOn", "Metadata", "PolicyAssignmentId", "PolicyDefinitionReferenceIds" })]
[Cmdlet(VerbsCommon.Set, AzureRMConstants.AzureRMPrefix + "PolicyExemption", DefaultParameterSetName = PolicyCmdletBase.NameParameterSet, SupportsShouldProcess = true), OutputType(typeof(PsPolicyExemption))]
public class SetAzurePolicyExemptionCmdlet : PolicyCmdletBase
{
diff --git a/src/Resources/ResourceManager/Implementation/Policy/SetAzurePolicySetDefinition.cs b/src/Resources/ResourceManager/Implementation/Policy/SetAzurePolicySetDefinition.cs
index b75773cc25bd..b4f55aa4deeb 100644
--- a/src/Resources/ResourceManager/Implementation/Policy/SetAzurePolicySetDefinition.cs
+++ b/src/Resources/ResourceManager/Implementation/Policy/SetAzurePolicySetDefinition.cs
@@ -27,6 +27,9 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation
///
/// Sets the policy definition.
///
+ [CmdletOutputBreakingChangeWithVersion(
+ typeof(PsPolicySetDefinition), deprecateByAzVersion: "11.0.0", deprecateByVersion: "7.0.0", DeprecatedOutputProperties = new[] { "Properties" },
+ NewOutputProperties = new[] { "Description", "DisplayName", "Metadata", "Parameters", "PolicyDefinitionGroups", "PolicyDefinitions", "PolicyType" })]
[Cmdlet(VerbsCommon.Set, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "PolicySetDefinition", DefaultParameterSetName = PolicyCmdletBase.NameParameterSet, SupportsShouldProcess = true), OutputType(typeof(PsPolicySetDefinition))]
public class SetAzurePolicySetDefinitionCmdlet : PolicyCmdletBase
{
diff --git a/src/Resources/Resources/ChangeLog.md b/src/Resources/Resources/ChangeLog.md
index abbe4c413d8a..d5e8e952b609 100644
--- a/src/Resources/Resources/ChangeLog.md
+++ b/src/Resources/Resources/ChangeLog.md
@@ -19,6 +19,7 @@
-->
## Upcoming Release
+* Added breaking change warnings for Azure Policy cmdlets.
* Added `AuxTenant` parameter in `New-AzResourceGroupDeployment`to support cross-tenant deployment.
* Fixed bug with custom types and deployments whatif. [#13245]
* Fixed bug with nullable array parameters & outputs.