Skip to content

Commit 4edfa6a

Browse files
Merge branch 'dev' of github.com:Azure/azure-powershell into roledefinitionfix
2 parents cc9860c + 9e7bce8 commit 4edfa6a

15 files changed

+8
-138
lines changed

src/ResourceManager/Resources/Commands.ResourceManager/Cmdlets/Implementation/Resource/NewAzureResourceCmdlet.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,6 @@ public sealed class NewAzureResourceCmdlet : ResourceManipulationCmdletBase
8787
protected override void OnProcessRecord()
8888
{
8989
base.OnProcessRecord();
90-
if(this.IsFullObject.IsPresent)
91-
{
92-
this.WriteWarning("The IsFullObject parameter is obsolete and will be removed in future releases.");
93-
}
9490

9591
var resourceId = this.GetResourceId();
9692
this.ConfirmAction(

src/ResourceManager/Resources/Commands.Resources.Test/ResourceGroupDeployments/RemoveAzureResourceGroupDeploymentCommandTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ public void RemoveDeployment()
5151

5252
cmdlet.ResourceGroupName = resourceGroupName;
5353
cmdlet.Name = deploymentName;
54-
cmdlet.PassThru = true;
5554
cmdlet.Force = true;
5655

5756
cmdlet.ExecuteCmdlet();

src/ResourceManager/Resources/Commands.Resources.Test/ResourceGroupDeployments/StopAzureResourceGroupDeploymentCommandTests.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ public void StopsActiveDeployment()
4848
commandRuntimeMock.Setup(f => f.ShouldProcess(It.IsAny<string>(), It.IsAny<string>())).Returns(true);
4949

5050
cmdlet.ResourceGroupName = resourceGroupName;
51-
cmdlet.PassThru = true;
5251
cmdlet.Force = true;
5352

5453
cmdlet.ExecuteCmdlet();

src/ResourceManager/Resources/Commands.Resources.Test/ScenarioTests/ResourceGroupTests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ function Test-RemoveDeployment
244244
# Test
245245
New-AzureRmResourceGroup -Name $rgName -Location "west us"
246246
$deployment = New-AzureRmResourceGroupDeployment -ResourceGroupName $rgName -Name $deploymentName -TemplateUri $templateUri
247-
Assert-True { Remove-AzureRmResourceGroupDeployment -ResourceGroupName $deployment.ResourceGroupName -Name $deployment.DeploymentName -Force -PassThru }
247+
Assert-True { Remove-AzureRmResourceGroupDeployment -ResourceGroupName $deployment.ResourceGroupName -Name $deployment.DeploymentName -Force }
248248
}
249249
finally
250250
{

src/ResourceManager/Resources/Commands.Resources/Microsoft.Azure.Commands.Resources.dll-Help.xml

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,13 +1683,6 @@ Tags:
16831683
</maml:description>
16841684
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
16851685
</command:parameter>
1686-
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="2">
1687-
<maml:name>ProvisioningState</maml:name>
1688-
<maml:description>
1689-
<maml:para>Gets only the deployments with the specified provisioning state. Valid values include, but are not limited to: Canceled, Deprovisioning, Failed, NotProvisioned, Provisioned, Provisioning, and Succeeded. This parameter is optional. By default, Get-AzureRmResourceGroupDeployment returns all deployments for the specified resource group.</maml:para>
1690-
</maml:description>
1691-
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
1692-
</command:parameter>
16931686
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
16941687
<maml:name>Profile</maml:name>
16951688
<maml:description>
@@ -1726,19 +1719,6 @@ Tags:
17261719
<dev:defaultValue>
17271720
</dev:defaultValue>
17281721
</command:parameter>
1729-
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="2">
1730-
<maml:name>ProvisioningState</maml:name>
1731-
<maml:description>
1732-
<maml:para>Gets only the deployments with the specified provisioning state. Valid values include, but are not limited to: Canceled, Deprovisioning, Failed, NotProvisioned, Provisioned, Provisioning, and Succeeded. This parameter is optional. By default, Get-AzureRmResourceGroupDeployment returns all deployments for the specified resource group.</maml:para>
1733-
</maml:description>
1734-
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
1735-
<dev:type>
1736-
<maml:name>String</maml:name>
1737-
<maml:uri />
1738-
</dev:type>
1739-
<dev:defaultValue>
1740-
</dev:defaultValue>
1741-
</command:parameter>
17421722
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
17431723
<maml:name>Profile</maml:name>
17441724
<maml:description>
@@ -1865,27 +1845,6 @@ Outputs :</dev:code>
18651845
</command:commandLine>
18661846
</command:commandLines>
18671847
</command:example>
1868-
<command:example>
1869-
<maml:title>-------------------------- Example 3: Get a deployment by provisioning state --------------------------</maml:title>
1870-
<maml:introduction>
1871-
<maml:paragraph>PS C:\&gt;</maml:paragraph>
1872-
</maml:introduction>
1873-
<dev:code>PS C:\&gt;Get-AzureRmResourceGroupDeployment -ResourceGroupName ContosoLabsRG -ProvisioningState NotProvisioned</dev:code>
1874-
<dev:remarks>
1875-
<maml:para>This command gets the deployments of the ContosoLabsRG resource group that are not yet provisioned.</maml:para>
1876-
<maml:para />
1877-
<maml:para />
1878-
<maml:para>
1879-
</maml:para>
1880-
</dev:remarks>
1881-
<command:commandLines>
1882-
<command:commandLine>
1883-
<command:commandText>
1884-
<maml:para />
1885-
</command:commandText>
1886-
</command:commandLine>
1887-
</command:commandLines>
1888-
</command:example>
18891848
<command:example>
18901849
<maml:title>-------------------------- Example 4: Get the deployments of all resource groups --------------------------</maml:title>
18911850
<maml:introduction>
@@ -9156,13 +9115,6 @@ Tags:
91569115
</maml:description>
91579116
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
91589117
</command:parameter>
9159-
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="3">
9160-
<maml:name>PassThru</maml:name>
9161-
<maml:description>
9162-
<maml:para>Returns $True when the stopping operation succeeds and $False when it fails. By default, this cmdlet does not generate any output.</maml:para>
9163-
</maml:description>
9164-
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
9165-
</command:parameter>
91669118
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
91679119
<maml:name>Profile</maml:name>
91689120
<maml:description>
@@ -9212,19 +9164,6 @@ Tags:
92129164
<dev:defaultValue>
92139165
</dev:defaultValue>
92149166
</command:parameter>
9215-
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="true (ByPropertyName)" position="3">
9216-
<maml:name>PassThru</maml:name>
9217-
<maml:description>
9218-
<maml:para>Returns $True when the stopping operation succeeds and $False when it fails. By default, this cmdlet does not generate any output.</maml:para>
9219-
</maml:description>
9220-
<command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue>
9221-
<dev:type>
9222-
<maml:name>SwitchParameter</maml:name>
9223-
<maml:uri />
9224-
</dev:type>
9225-
<dev:defaultValue>
9226-
</dev:defaultValue>
9227-
</command:parameter>
92289167
<command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named">
92299168
<maml:name>Profile</maml:name>
92309169
<maml:description>

src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/PSResourceGroup.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,6 @@ public string ResourcesTable
3333

3434
public string ProvisioningState { get; set; }
3535

36-
public List<PSPermission> Permissions { get; set; }
37-
38-
public string PermissionsTable
39-
{
40-
get { return ResourcesExtensions.ConstructPermissionsTable(Permissions); }
41-
}
42-
4336
public Hashtable[] Tags { get; set; }
4437

4538
public string TagsTable

src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourceClient.ResourceManager.cs

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,6 @@ public virtual PSResourceGroupDeployment ExecuteDeployment(CreatePSResourceGroup
304304
parameters.DeploymentName = GenerateDeploymentName(parameters);
305305
Deployment deployment = CreateBasicDeployment(parameters, parameters.DeploymentMode);
306306

307-
if (!string.IsNullOrEmpty(parameters.StorageAccountName))
308-
{
309-
WriteWarning("The StorageAccountName parameter is no longer used and will be removed in a future release. Please update scripts to remove this parameter.");
310-
}
311-
312307
ResourceManagementClient.Deployments.CreateOrUpdate(parameters.ResourceGroupName, parameters.DeploymentName, deployment);
313308
WriteVerbose(string.Format("Create template deployment '{0}'.", parameters.DeploymentName));
314309
DeploymentExtended result = ProvisionDeploymentStatus(parameters.ResourceGroupName, parameters.DeploymentName, deployment);
@@ -463,22 +458,14 @@ public virtual List<PSResourceGroupDeployment> FilterResourceGroupDeployments(Fi
463458
string resourceGroup = options.ResourceGroupName;
464459
string name = options.DeploymentName;
465460
List<string> excludedProvisioningStates = options.ExcludedProvisioningStates ?? new List<string>();
466-
List<string> provisioningStates = options.ProvisioningStates ?? new List<string>();
467461

468462
if (!string.IsNullOrEmpty(resourceGroup) && !string.IsNullOrEmpty(name))
469463
{
470464
deployments.Add(ResourceManagementClient.Deployments.Get(resourceGroup, name).ToPSResourceGroupDeployment(options.ResourceGroupName));
471465
}
472466
else if (!string.IsNullOrEmpty(resourceGroup))
473467
{
474-
DeploymentListParameters parameters = new DeploymentListParameters();
475-
476-
if (provisioningStates.Count == 1)
477-
{
478-
parameters.ProvisioningState = provisioningStates.First();
479-
}
480-
481-
DeploymentListResult result = ResourceManagementClient.Deployments.List(resourceGroup, parameters);
468+
DeploymentListResult result = ResourceManagementClient.Deployments.List(resourceGroup, null);
482469

483470
deployments.AddRange(result.Deployments.Select(d => d.ToPSResourceGroupDeployment(options.ResourceGroupName)));
484471

@@ -489,12 +476,7 @@ public virtual List<PSResourceGroupDeployment> FilterResourceGroupDeployments(Fi
489476
}
490477
}
491478

492-
if (provisioningStates.Count > 1)
493-
{
494-
return deployments.Where(d => provisioningStates
495-
.Any(s => s.Equals(d.ProvisioningState, StringComparison.OrdinalIgnoreCase))).ToList();
496-
}
497-
else if (provisioningStates.Count == 0 && excludedProvisioningStates.Count > 0)
479+
if(excludedProvisioningStates.Count > 0)
498480
{
499481
return deployments.Where(d => excludedProvisioningStates
500482
.All(s => !s.Equals(d.ProvisioningState, StringComparison.OrdinalIgnoreCase))).ToList();

src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourceClient.cs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -409,18 +409,6 @@ private TemplateValidationInfo CheckBasicDeploymentErrors(string resourceGroup,
409409
return new TemplateValidationInfo(validationResult);
410410
}
411411

412-
internal List<PSPermission> GetResourceGroupPermissions(string resourceGroup)
413-
{
414-
PermissionGetResult permissionsResult = AuthorizationManagementClient.Permissions.ListForResourceGroup(resourceGroup);
415-
416-
if (permissionsResult != null)
417-
{
418-
return permissionsResult.Permissions.Select(p => p.ToPSPermission()).ToList();
419-
}
420-
421-
return null;
422-
}
423-
424412
internal List<PSPermission> GetResourcePermissions(ResourceIdentifier identity)
425413
{
426414
PermissionGetResult permissionsResult = AuthorizationManagementClient.Permissions.ListForResource(

src/ResourceManager/Resources/Commands.Resources/Models.ResourceGroups/ResourcesExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public static PSResourceGroup ToPSResourceGroup(this ResourceGroupExtended resou
4646
{
4747
result.Resources = client.FilterResources(new FilterResourcesOptions { ResourceGroup = resourceGroup.Name })
4848
.Select(r => r.ToPSResource(client, true)).ToList();
49-
result.Permissions = client.GetResourceGroupPermissions(resourceGroup.Name);
5049
}
5150

5251
return result;

src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/GetAzureResourceGroupDeploymentCommand.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ public class GetAzureResourceGroupDeploymentCommand : ResourcesBaseCmdlet
4444
[ValidateNotNullOrEmpty]
4545
public string Name { get; set; }
4646

47-
[Parameter(Mandatory = false, HelpMessage = "The provisioning state of the resource group deployment.")]
48-
[ValidateNotNullOrEmpty]
49-
public string ProvisioningState { get; set; }
50-
5147
[Alias("DeploymentId", "ResourceId")]
5248
[Parameter(ParameterSetName = GetAzureResourceGroupDeploymentCommand.DeploymentIdParameterSet, Mandatory = true, HelpMessage = "The fully qualified resource Id of the deployment. example: /subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Resources/deployments/{deploymentName}")]
5349
[ValidateNotNullOrEmpty]
@@ -58,15 +54,9 @@ protected override void ProcessRecord()
5854
FilterResourceGroupDeploymentOptions options = new FilterResourceGroupDeploymentOptions()
5955
{
6056
ResourceGroupName = ResourceGroupName ?? ResourceIdUtility.GetResourceGroupName(Id),
61-
DeploymentName = Name ?? (string.IsNullOrEmpty(Id) ? null : ResourceIdUtility.GetResourceName(Id)),
62-
ProvisioningStates = string.IsNullOrEmpty(ProvisioningState) ? new List<string>() :
63-
new List<string>() { ProvisioningState }
57+
DeploymentName = Name ?? (string.IsNullOrEmpty(Id) ? null : ResourceIdUtility.GetResourceName(Id))
6458
};
6559

66-
if(!string.IsNullOrEmpty(ProvisioningState))
67-
{
68-
WriteWarning("The ProvisioningState parameter is being deprecated and will be removed in a future release.");
69-
}
7060
WriteObject(ResourcesClient.FilterResourceGroupDeployments(options), true);
7161
}
7262
}

src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/RemoveAzureResourceGroupDeploymentCommand.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ public class RemoveAzureResourceGroupDeploymentCommand : ResourcesBaseCmdlet
5252
[Parameter(Mandatory = false, HelpMessage = "Do not confirm the remove.")]
5353
public SwitchParameter Force { get; set; }
5454

55-
[Parameter(Mandatory = false, HelpMessage = "True if succeed, false otherwise.")]
56-
public SwitchParameter PassThru { get; set; }
57-
5855
protected override void ProcessRecord()
5956
{
6057
if(string.IsNullOrEmpty(ResourceGroupName) && string.IsNullOrEmpty(Name))
@@ -69,11 +66,8 @@ protected override void ProcessRecord()
6966
ResourceGroupName,
7067
() => ResourcesClient.DeleteDeployment(ResourceGroupName, Name));
7168

72-
if (PassThru)
73-
{
74-
WriteWarning("The PassThru switch parameter is being deprecated and will be removed in a future release.");
75-
WriteObject(true);
76-
}
69+
WriteObject(true);
70+
7771
}
7872
}
7973
}

src/ResourceManager/Resources/Commands.Resources/ResourceGroupDeployments/StopAzureResourceGroupDeploymentCommand.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ public class StopAzureResourceGroupDeploymentCommand : ResourcesBaseCmdlet
5252
[Parameter(Mandatory = false, HelpMessage = "Do not confirm the stop.")]
5353
public SwitchParameter Force { get; set; }
5454

55-
[Parameter(Mandatory = false, HelpMessage = "True if succeed, false otherwise.")]
56-
public SwitchParameter PassThru { get; set; }
57-
5855
protected override void ProcessRecord()
5956
{
6057
if (string.IsNullOrEmpty(ResourceGroupName) && string.IsNullOrEmpty(Name))
@@ -69,11 +66,8 @@ protected override void ProcessRecord()
6966
ResourceGroupName,
7067
() => ResourcesClient.CancelDeployment(ResourceGroupName, Name));
7168

72-
if (PassThru)
73-
{
74-
WriteWarning("The output object of this cmdlet will be modified in a future release.");
75-
WriteObject(true);
76-
}
69+
WriteObject(true);
70+
7771
}
7872
}
7973
}

src/ResourceManager/Resources/Commands.Resources/ResourceGroups/GetAzureResourceGroupCommand.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ public class GetAzureResourceGroupCommand : ResourcesBaseCmdlet, IModuleAssembly
5353

5454
protected override void ProcessRecord()
5555
{
56-
WriteWarning("The output object of this cmdlet will be modified in a future release.");
5756
Name = Name ?? ResourceIdentifier.FromResourceGroupIdentifier(this.Id).ResourceGroupName;
5857

5958
this.WriteObject(

src/ResourceManager/Resources/Commands.Resources/ResourceGroups/NewAzureResourceGroupCommand.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ protected override void ProcessRecord()
5353
ConfirmAction = ConfirmAction
5454
};
5555

56-
WriteWarning("The output object of this cmdlet will be modified in a future release.");
5756
WriteObject(ResourcesClient.CreatePSResourceGroup(parameters));
5857
}
5958
}

src/ResourceManager/Resources/Commands.Resources/ResourceGroups/SetAzureResourceGroupCommand.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ protected override void ProcessRecord()
5757
ResourceGroupName = Name ?? ResourceIdentifier.FromResourceGroupIdentifier(this.Id).ResourceGroupName,
5858
Tag = Tag,
5959
};
60-
WriteWarning("The output object of this cmdlet will be modified in a future release.");
6160
WriteObject(ResourcesClient.UpdatePSResourceGroup(parameters));
6261
}
6362
}

0 commit comments

Comments
 (0)