diff --git a/src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceCmdlet.cs b/src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceCmdlet.cs index 3f5d838d80cc..f0357ad23ee0 100644 --- a/src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceCmdlet.cs +++ b/src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceCmdlet.cs @@ -108,7 +108,6 @@ public sealed class GetAzureResourceCmdlet : ResourceManagerCmdletBase /// [Parameter(ParameterSetName = GetAzureResourceCmdlet.GetResourceParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = false, HelpMessage = "The parent resource type. e.g. Servers/myServer.")] [ValidateNotNullOrEmpty] - [Obsolete("This parameter is obsolete and will be removed in future releases. Please use the -ResourceType and -ResourceName parameters instead.")] public string ParentResource { get; set; } /// @@ -232,6 +231,14 @@ public GetAzureResourceCmdlet() protected override void OnProcessRecord() { base.OnProcessRecord(); + if(!string.IsNullOrEmpty(this.TagName) || !string.IsNullOrEmpty(this.TagValue)) + { + this.WriteWarning("The TagName and TagValue parameters are obsolete and will be removed in future releases."); + } + if(!string.IsNullOrEmpty(this.ParentResource)) + { + this.WriteWarning("The ParentResource parameter is obsolete and will be removed in future releases. Please use the -ResourceType and -ResourceName parameters instead."); + } this.subscriptionIds.AddRange(this.SubscriptionId.CoalesceEnumerable()); } diff --git a/src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceGroupDeploymentOperationCmdlet.cs b/src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceGroupDeploymentOperationCmdlet.cs index aacc7d822d9e..6ca1e8e0a21b 100644 --- a/src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceGroupDeploymentOperationCmdlet.cs +++ b/src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/GetAzureResourceGroupDeploymentOperationCmdlet.cs @@ -62,6 +62,11 @@ protected override void OnProcessRecord() this.SubscriptionId = this.Profile.Context.Subscription.Id; } + if(!string.IsNullOrEmpty(this.ApiVersion)) + { + this.WriteWarning("The parameter ApiVersion in Get-AzureResourceGroupDeploymentOperation cmdlet is being deprecated and will be removed in a future release."); + } + this.RunCmdlet(); } diff --git a/src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/MoveAzureResourceCmdlet.cs b/src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/MoveAzureResourceCmdlet.cs index f0cd604cb13f..006e38b012be 100644 --- a/src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/MoveAzureResourceCmdlet.cs +++ b/src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/MoveAzureResourceCmdlet.cs @@ -101,6 +101,10 @@ protected override void OnEndProcessing() /// private void RunCmdlet() { + if(this.NoWait.IsPresent) + { + this.WriteWarning("The NoWait parameter is obsolete and will be removed in future releases."); + } var resourceIdsToUse = this.resourceIds .Concat(this.ResourceId) .DistinctArray(StringComparer.InvariantCultureIgnoreCase); diff --git a/src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/NewAzureResourceCmdlet.cs b/src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/NewAzureResourceCmdlet.cs index 05b8ca0f26a5..d3bc64018b87 100644 --- a/src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/NewAzureResourceCmdlet.cs +++ b/src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/NewAzureResourceCmdlet.cs @@ -14,6 +14,7 @@ namespace Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation { + using System; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -94,6 +95,10 @@ protected override void OnProcessRecord() { base.OnProcessRecord(); this.DetermineOutputObjectFormat(); + if(this.IsFullObject.IsPresent) + { + this.WriteWarning("The IsFullObject parameter is obsolete and will be removed in future releases."); + } if (this.OutputObjectFormat == ResourceObjectFormat.Legacy) { this.WriteWarning("This cmdlet is using the legacy properties object format. This format is being deprecated. Please use '-OutputObjectFormat New' and update your scripts."); diff --git a/src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/ResourceManipulationCmdletBase.cs b/src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/ResourceManipulationCmdletBase.cs index 302d4f26dc27..33d368ea24a6 100644 --- a/src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/ResourceManipulationCmdletBase.cs +++ b/src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/ResourceManipulationCmdletBase.cs @@ -68,7 +68,6 @@ public abstract class ResourceManipulationCmdletBase : ResourceManagerCmdletBase /// [Parameter(ParameterSetName = ResourceManipulationCmdletBase.SubscriptionLevelResoruceParameterSet, Mandatory = false, ValueFromPipelineByPropertyName = false, HelpMessage = "The parent resource type. e.g. Servers/myServer.")] [ValidateNotNullOrEmpty] - [Obsolete("This parameter is obsolete and will be removed in future releases. Please use the -ResourceType and -ResourceName parameters instead.")] public string ParentResource { get; set; } /// @@ -125,6 +124,14 @@ public abstract class ResourceManipulationCmdletBase : ResourceManagerCmdletBase /// protected override void OnProcessRecord() { + if(this.SubscriptionId != null) + { + this.WriteWarning("The SubscriptionId parameter is obsolete and will be removed in future releases."); + } + if (!string.IsNullOrEmpty(this.ParentResource)) + { + this.WriteWarning("The ParentResource parameter is obsolete and will be removed in future releases. Please use the -ResourceType and -ResourceName parameters instead."); + } if (string.IsNullOrWhiteSpace(this.ResourceId) && !this.TenantLevel && this.SubscriptionId == null) { this.SubscriptionId = this.Profile.Context.Subscription.Id; diff --git a/src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/SetAzureResourceCmdlet.cs b/src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/SetAzureResourceCmdlet.cs index d47782fbf631..dbed23eda8d5 100644 --- a/src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/SetAzureResourceCmdlet.cs +++ b/src/ResourceManager/ResourceManager/Commands.ResourceManager/Cmdlets/Implementation/SetAzureResourceCmdlet.cs @@ -85,6 +85,11 @@ protected override void OnProcessRecord() this.WriteWarning("This cmdlet is using the legacy properties object format. This format is being deprecated. Please use '-OutputObjectFormat New' and update your scripts."); } + if(!string.IsNullOrEmpty(this.ODataQuery)) + { + this.WriteWarning("The ODataQuery parameter is being deprecated in Set-AzureResource cmdlet and will be removed in a future release."); + } + var resourceId = this.GetResourceId(); this.ConfirmAction( this.Force, diff --git a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/GetAzureResourceGroupDeploymentCommand.cs b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/GetAzureResourceGroupDeploymentCommand.cs index 03159c852894..9e62bfdf2ce6 100644 --- a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/GetAzureResourceGroupDeploymentCommand.cs +++ b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/GetAzureResourceGroupDeploymentCommand.cs @@ -47,6 +47,11 @@ public override void ExecuteCmdlet() new List() { ProvisioningState } }; + if(!string.IsNullOrEmpty(Name)) + { + WriteWarning("The parameter 'Name' in Get-AzureResourceGroupDeployment cmdlet is being renamed to DeploymentName and will be updated in a future release."); + } + WriteObject(ResourcesClient.FilterResourceGroupDeployments(options), true); } } diff --git a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/NewAzureResourceGroupDeploymentCommand.cs b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/NewAzureResourceGroupDeploymentCommand.cs index acf6650971c9..916570c27eba 100644 --- a/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/NewAzureResourceGroupDeploymentCommand.cs +++ b/src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/NewAzureResourceGroupDeploymentCommand.cs @@ -61,6 +61,11 @@ public override void ExecuteCmdlet() StorageAccountName = StorageAccountName }; + if(!string.IsNullOrEmpty(TemplateVersion) || !string.IsNullOrEmpty(StorageAccountName)) + { + WriteWarning("The TemplateVersion and StorageAccountName parameters in New-AzureResourceGroupDeployment cmdlet is being deprecated and will be removed in a future release."); + } + if(this.Mode == DeploymentMode.Complete) { this.ConfirmAction( diff --git a/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/NewAzureResourceGroupCommand.cs b/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/NewAzureResourceGroupCommand.cs index 65749bef5122..f1c2f1c2d8d8 100644 --- a/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/NewAzureResourceGroupCommand.cs +++ b/src/ResourceManager/Resources/Commands.Resources/ResourceGroups/NewAzureResourceGroupCommand.cs @@ -62,7 +62,11 @@ public override void ExecuteCmdlet() Tag = Tag, ConfirmAction = ConfirmAction }; - + if(!string.IsNullOrEmpty(DeploymentName) || !string.IsNullOrEmpty(GalleryTemplateIdentity) || !string.IsNullOrEmpty(TemplateFile) + || !string.IsNullOrEmpty(TemplateVersion) || TemplateParameterObject != null || !string.IsNullOrEmpty(StorageAccountName)) + { + WriteWarning("The deployment parameters in New-AzureResourceGroup cmdlet is being deprecated and will be removed in a future release. Please use New-AzureResourceGroupDeployment to submit deployments."); + } WriteObject(ResourcesClient.CreatePSResourceGroup(parameters)); } }