Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/PolicyInsights/PolicyInsights/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- Additional information about change #1
-->
## Upcoming Release
* Added Breaking Change notifications to many of the cmdlets in Az.PolicyInsights.

## Version 1.7.3
* Updated Azure.Core from 1.47.3 to 1.50.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,38 @@
// limitations under the License.
// ----------------------------------------------------------------------------------

using Microsoft.Azure.Commands.Common.Exceptions;
using Microsoft.Azure.Commands.PolicyInsights.Common;
using Microsoft.Azure.Commands.PolicyInsights.Models;
using Microsoft.Azure.Commands.PolicyInsights.Models.Attestations;
using Microsoft.Azure.Commands.PolicyInsights.Models.Remediation;
using Microsoft.Azure.Commands.PolicyInsights.Properties;
using Microsoft.Azure.Commands.ResourceManager.Common;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Management.Internal.Resources.Models;
using Microsoft.Azure.Management.PolicyInsights.Models;
using Microsoft.Azure.Management.PolicyInsights;
using Microsoft.Azure.Management.PolicyInsights.Models;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using System.Text;
using Microsoft.Azure.Commands.PolicyInsights.Properties;
using Microsoft.Azure.Commands.PolicyInsights.Models;
using System.Linq;
using Microsoft.Azure.Commands.PolicyInsights.Models.Attestations;
using Microsoft.Azure.Commands.Common.Exceptions;

namespace Microsoft.Azure.Commands.PolicyInsights.Cmdlets.Attestations
{
/// <summary>
/// Gets policy attestations.
/// </summary>
[CmdletOutputBreakingChangeWithVersion(
typeof(PSAttestation),
deprecateByAzVersion: "16.0.0",
deprecateByVersion: "2.0.0",
ReplacementCmdletOutputTypeName = "Attestation",
DeprecatedOutputProperties = new string[] { "SystemData" },
NewOutputProperties = new string[] { "ResourceGroupName", "SystemDataCreatedAt", "SystemDataCreatedBy", "SystemDataCreatedByType", "SystemDataLastModifiedAt", "SystemDataLastModifiedBy", "SystemDataLastModifiedByType" }
)]
[Cmdlet(VerbsCommon.Get, AzureRMConstants.AzureRMPrefix + "PolicyAttestation", DefaultParameterSetName = ParameterSetNames.SubscriptionScope), OutputType(typeof(PSAttestation))]
public class GetAzureRmPolicyAttestation : AttestationCmdletBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Management.PolicyInsights;
using Microsoft.Azure.Management.PolicyInsights.Models;

using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using System;
using System.Globalization;
using System.Linq;
Expand All @@ -31,6 +31,14 @@ namespace Microsoft.Azure.Commands.PolicyInsights.Cmdlets.Attestations
/// <summary>
/// Creates a new Policy Attestation
/// </summary>
[CmdletOutputBreakingChangeWithVersion(
typeof(PSAttestation),
deprecateByAzVersion: "16.0.0",
deprecateByVersion: "2.0.0",
ReplacementCmdletOutputTypeName = "Attestation",
DeprecatedOutputProperties = new string[] { "SystemData" },
NewOutputProperties = new string[] { "ResourceGroupName", "SystemDataCreatedAt", "SystemDataCreatedBy", "SystemDataCreatedByType", "SystemDataLastModifiedAt", "SystemDataLastModifiedBy", "SystemDataLastModifiedByType" }
)]
[Cmdlet(VerbsCommon.New, AzureRMConstants.AzureRMPrefix + "PolicyAttestation", DefaultParameterSetName = ParameterSetNames.ByName, SupportsShouldProcess = true), OutputType(typeof(PSAttestation))]
public class NewAzureRmPolicyAttestation : AttestationCmdletBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Management.PolicyInsights;
using Microsoft.Azure.Management.PolicyInsights.Models;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using System;
using System.Collections.Generic;
Expand All @@ -34,6 +35,14 @@ namespace Microsoft.Azure.Commands.PolicyInsights.Cmdlets.Attestations
/// <summary>
/// Updates a policy attestation.
/// </summary>
[CmdletOutputBreakingChangeWithVersion(
typeof(PSAttestation),
deprecateByAzVersion: "16.0.0",
deprecateByVersion: "2.0.0",
ReplacementCmdletOutputTypeName = "Attestation",
DeprecatedOutputProperties = new string[] { "SystemData" },
NewOutputProperties = new string[] { "ResourceGroupName", "SystemDataCreatedAt", "SystemDataCreatedBy", "SystemDataCreatedByType", "SystemDataLastModifiedAt", "SystemDataLastModifiedBy", "SystemDataLastModifiedByType" }
)]
[Cmdlet(verbName: VerbsCommon.Set, AzureRMConstants.AzureRMPrefix + "PolicyAttestation", DefaultParameterSetName = ParameterSetNames.ByName, SupportsShouldProcess = true), OutputType(typeof(PSAttestation))]
public class SetAzureRmPolicyAttestation : AttestationCmdletBase
{
Expand Down
14 changes: 11 additions & 3 deletions src/PolicyInsights/PolicyInsights/Cmdlets/GetAzPolicyMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,27 @@

namespace Microsoft.Azure.Commands.PolicyInsights.Cmdlets
{
using System.Linq;
using System.Management.Automation;
using System.Threading;
using Microsoft.Azure.Commands.PolicyInsights.Common;
using Microsoft.Azure.Commands.PolicyInsights.Models;
using Microsoft.Azure.Commands.ResourceManager.Common;
using Microsoft.Azure.Management.PolicyInsights;
using Microsoft.Azure.Management.PolicyInsights.Models;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using System.Linq;
using System.Management.Automation;
using System.Threading;

/// <summary>
/// Gets policy metadata.
/// </summary>
[CmdletOutputBreakingChangeWithVersion(
typeof(PSPolicyMetadata),
deprecateByAzVersion: "16.0.0",
deprecateByVersion: "2.0.0",
ReplacementCmdletOutputTypeName = "PolicyMetadata",
NewOutputProperties = new string[] { "ResourceGroupName" }
)]
[Cmdlet("Get", AzureRMConstants.AzureRMPrefix + "PolicyMetadata"), OutputType(typeof(PSPolicyMetadata))]
public class GetAzPolicyMetadata : PolicyInsightsCmdletBase
{
Expand Down
17 changes: 13 additions & 4 deletions src/PolicyInsights/PolicyInsights/Cmdlets/GetAzureRmPolicyEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,28 @@

namespace Microsoft.Azure.Commands.PolicyInsights.Cmdlets
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using Microsoft.Azure.Commands.PolicyInsights.Common;
using Microsoft.Azure.Commands.PolicyInsights.Models;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Management.PolicyInsights;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using RestApiModels = Microsoft.Azure.Management.PolicyInsights.Models;

/// <summary>
/// Gets policy events
/// </summary>
[CmdletOutputBreakingChangeWithVersion(
typeof(PolicyEvent),
deprecateByAzVersion: "16.0.0",
deprecateByVersion: "2.0.0",
DeprecatedOutputProperties = new string[] { "ResourceTags", "ManagementGroupIds" },
NewOutputProperties = new string[] { "ResourceTag", "ManagementGroupId", "ComplianceState", "Component", "EffectiveParameter", "OdataContext", "OdataId",
"Keys", "Values", "Count", "AdditionalProperties" }
)]
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "PolicyEvent", DefaultParameterSetName = ParameterSetNames.SubscriptionScope), OutputType(typeof(PolicyEvent))]
public class GetAzureRmPolicyEvent : PolicyInsightsCmdletBase
{
Expand Down
16 changes: 12 additions & 4 deletions src/PolicyInsights/PolicyInsights/Cmdlets/GetAzureRmPolicyState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,27 @@

namespace Microsoft.Azure.Commands.PolicyInsights.Cmdlets
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using Microsoft.Azure.Commands.PolicyInsights.Common;
using Microsoft.Azure.Commands.PolicyInsights.Models;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Management.PolicyInsights;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using RestApiModels = Microsoft.Azure.Management.PolicyInsights.Models;

/// <summary>
/// Gets policy states
/// </summary>
[CmdletOutputBreakingChangeWithVersion(
typeof(PolicyState),
deprecateByAzVersion: "16.0.0",
deprecateByVersion: "2.0.0",
DeprecatedOutputProperties = new string[] { "ResourceTags", "ManagementGroupIds" },
NewOutputProperties = new string[] { "ResourceGroupName", "ResourceTag", "ManagementGroupId" }
)]
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "PolicyState", DefaultParameterSetName = ParameterSetNames.SubscriptionScope), OutputType(typeof(PolicyState))]
public class GetAzureRmPolicyState : PolicyInsightsCmdletBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,28 @@

namespace Microsoft.Azure.Commands.PolicyInsights.Cmdlets
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using Microsoft.Azure.Commands.PolicyInsights.Common;
using Microsoft.Azure.Commands.PolicyInsights.Models;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Management.PolicyInsights;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using RestApiModels = Microsoft.Azure.Management.PolicyInsights.Models;

/// <summary>
/// Gets policy states
/// </summary>
[CmdletOutputBreakingChangeWithVersion(
typeof(PolicyStateSummary),
deprecateByAzVersion: "16.0.0",
deprecateByVersion: "2.0.0",
DeprecatedOutputProperties = new string[] { "PolicyAssignments", "Results" },
NewOutputProperties = new string[] { "PolicyAssignment", "ResultCompliantResource", "ResultNonCompliantPolicy", "ResultNonCompliantResource", "ResultPolicyDetail",
"ResultPolicyGroupDetail", "ResultQueryResultsUri", "ResultResourceDetail", "OdataId", "OdataContext" }
)]
[Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "PolicyStateSummary", DefaultParameterSetName = ParameterSetNames.SubscriptionScope), OutputType(typeof(PolicyStateSummary))]
public class GetAzureRmPolicyStateSummary : PolicyInsightsCmdletBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,31 @@

namespace Microsoft.Azure.Commands.PolicyInsights.Cmdlets.Remediation
{
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;
using Microsoft.Azure.Commands.PolicyInsights.Common;
using Microsoft.Azure.Commands.PolicyInsights.Models.Remediation;
using Microsoft.Azure.Commands.PolicyInsights.Properties;
using Microsoft.Azure.Commands.ResourceManager.Common;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Management.PolicyInsights;
using Microsoft.Azure.Management.PolicyInsights.Models;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using Microsoft.WindowsAzure.Commands.Utilities.Common;
using System.Collections.Generic;
using System.Linq;
using System.Management.Automation;

/// <summary>
/// Gets policy remediations.
/// </summary>
[CmdletOutputBreakingChangeWithVersion(
typeof(PSRemediation),
deprecateByAzVersion: "16.0.0",
deprecateByVersion: "2.0.0",
ReplacementCmdletOutputTypeName = "Remediation",
DeprecatedOutputProperties = new string[] { "Filters", "DeploymentSummary", "FailureThreshold", "ParallelDeployments" },
NewOutputProperties = new string[] { "FilterLocation", "FilterResourceId", "DeploymentStatusFailedDeployment", "DeploymentStatusSuccessfulDeployment", "DeploymentStatusTotalDeployment", "FailureThresholdPercentage", "ParallelDeployment",
"ResourceGroupName", "SystemDataCreatedAt", "SystemDataCreatedBy", "SystemDataCreatedByType", "SystemDataLastModifiedAt", "SystemDataLastModifiedBy", "SystemDataLastModifiedByType" }
)]
[Cmdlet("Get", AzureRMConstants.AzureRMPrefix + "PolicyRemediation", DefaultParameterSetName = ParameterSetNames.SubscriptionScope), OutputType(typeof(PSRemediation))]
public class GetAzureRmPolicyRemediation : RemediationCmdletBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,31 @@

namespace Microsoft.Azure.Commands.PolicyInsights.Cmdlets.Remediation
{
using System.Globalization;
using System.Linq;
using System.Management.Automation;
using Microsoft.Azure.Commands.PolicyInsights.Common;
using Microsoft.Azure.Commands.PolicyInsights.Models.Remediation;
using Microsoft.Azure.Commands.PolicyInsights.Properties;
using Microsoft.Azure.Commands.ResourceManager.Common;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Management.PolicyInsights;
using Microsoft.Azure.Management.PolicyInsights.Models;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using System.Globalization;
using System.Linq;
using System.Management.Automation;

/// <summary>
/// Creates and starts a policy remediation.
/// </summary>
[CmdletOutputBreakingChangeWithVersion(
typeof(PSRemediation),
deprecateByAzVersion: "16.0.0",
deprecateByVersion: "2.0.0",
ReplacementCmdletOutputTypeName = "Remediation",
DeprecatedOutputProperties = new string[] { "Filters", "DeploymentSummary", "FailureThreshold", "ParallelDeployments" },
NewOutputProperties = new string[] { "FilterLocation", "FilterResourceId", "DeploymentStatusFailedDeployment", "DeploymentStatusSuccessfulDeployment", "DeploymentStatusTotalDeployment", "FailureThresholdPercentage", "ParallelDeployment",
"ResourceGroupName", "SystemDataCreatedAt", "SystemDataCreatedBy", "SystemDataCreatedByType", "SystemDataLastModifiedAt", "SystemDataLastModifiedBy", "SystemDataLastModifiedByType" },
ChangeDescription = "Start-AzPolicyRemediation will now return when the Remediation reaches a terminal state unless you use the new NoWait parameter."
)]
[Cmdlet("Start", AzureRMConstants.AzureRMPrefix + "PolicyRemediation", DefaultParameterSetName = ParameterSetNames.ByName, SupportsShouldProcess = true), OutputType(typeof(PSRemediation))]
public class StartAzureRmPolicyRemediation : RemediationCmdletBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,27 @@

namespace Microsoft.Azure.Commands.PolicyInsights.Cmdlets.Remediation
{
using System.Globalization;
using System.Linq;
using System.Management.Automation;
using Microsoft.Azure.Commands.PolicyInsights.Common;
using Microsoft.Azure.Commands.PolicyInsights.Models.Remediation;
using Microsoft.Azure.Commands.PolicyInsights.Properties;
using Microsoft.Azure.Commands.ResourceManager.Common;
using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters;
using Microsoft.Azure.Management.PolicyInsights;
using Microsoft.WindowsAzure.Commands.Common.CustomAttributes;
using System.Globalization;
using System.Linq;
using System.Management.Automation;

/// <summary>
/// Cancels a policy remediation.
/// </summary>
[CmdletOutputBreakingChangeWithVersion(
typeof(bool),
deprecateByAzVersion: "16.0.0",
deprecateByVersion: "2.0.0",
ReplacementCmdletOutputTypeName = "Remediation",
ChangeDescription = "Stop-AzPolicyRemediation will now have a NoWait switch parameter as well as returning the Remediation object instead of just a boolean."
)]
[Cmdlet("Stop", AzureRMConstants.AzureRMPrefix + "PolicyRemediation", DefaultParameterSetName = ParameterSetNames.ByName, SupportsShouldProcess = true), OutputType(typeof(bool))]
public class StopAzureRmPolicyRemediation : RemediationCmdletBase
{
Expand Down
Loading