Skip to content

Commit a9d8c61

Browse files
authored
Merge pull request Azure#11166 from dingmeng-xue/fix-resources
Fix resources issues
2 parents acc55b6 + e61b1d4 commit a9d8c61

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

src/Resources/Resources/ActiveDirectory/Cmdlets/RemoveAzureADGroupCommand.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using Microsoft.WindowsAzure.Commands.Utilities.Common;
16-
using System;
17-
using System.Linq;
1816
using System.Management.Automation;
1917
using ProjectResources = Microsoft.Azure.Commands.Resources.Properties.Resources;
2018

@@ -36,10 +34,10 @@ public class RemoveAzureADGroupCommand : ActiveDirectoryBaseCmdlet
3634
[ValidateNotNullOrEmpty]
3735
public PSADGroup InputObject { get; set; }
3836

39-
[Parameter(Mandatory = true)]
37+
[Parameter(Mandatory = false)]
4038
public SwitchParameter PassThru { get; set; }
4139

42-
[Parameter(Mandatory = true)]
40+
[Parameter(Mandatory = false)]
4341
public SwitchParameter Force { get; set; }
4442

4543
public override void ExecuteCmdlet()

src/Resources/Resources/ActiveDirectory/Models/ActiveDirectoryClientExtensions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ public static PSADObject ToPSADObject(this AADObject obj)
6060
Id = obj.ObjectId,
6161
Type = obj.ObjectType,
6262
SecurityEnabled = obj.SecurityEnabled,
63-
MailNickname = !string.IsNullOrEmpty(obj.Mail) ? obj.Mail : obj.AdditionalProperties.ContainsKey("mailNickname") ? obj.AdditionalProperties["mailNickname"]?.ToString() : null,
63+
MailNickname = !string.IsNullOrEmpty(obj.Mail) ? obj.Mail :
64+
!string.IsNullOrEmpty(obj.MailNickname) ? obj.MailNickname :
65+
obj.AdditionalProperties.ContainsKey("mailNickname") ? obj.AdditionalProperties["mailNickname"]?.ToString() : null,
6466
Description = obj.AdditionalProperties.ContainsKey("description") ? obj.AdditionalProperties["description"]?.ToString() : null
6567
};
6668
}

src/Resources/Resources/ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Fixed for null reference bug in `Get-AzRoleAssignment`
22+
* Marked switch `-Force` and `-PassThru` optional in `Remove-AzADGroup` (#10849)
23+
* Fixed issue that `MailNickname` doesn't return in `Remove-AzADGroup` (#11167)
2124
* Fix for null reference bug in GetAzureRoleAssignmentCommand
2225
* Add breaking change attributes for upcoming changes to policy cmdlets
2326
* Updated `Get-AzResourceGroup` to perform resource group tag filtering on server-side

src/Resources/Resources/help/Remove-AzADGroup.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Type: System.Management.Automation.SwitchParameter
9191
Parameter Sets: (All)
9292
Aliases:
9393

94-
Required: True
94+
Required: False
9595
Position: Named
9696
Default value: None
9797
Accept pipeline input: False
@@ -136,7 +136,7 @@ Type: System.Management.Automation.SwitchParameter
136136
Parameter Sets: (All)
137137
Aliases:
138138

139-
Required: True
139+
Required: False
140140
Position: Named
141141
Default value: None
142142
Accept pipeline input: False

0 commit comments

Comments
 (0)