@@ -48,7 +48,6 @@ $ApiVersion | ForEach-Object {
48
48
$SplitFileName = $_.BaseName.Split (" _" )
49
49
$CommandName = (New-Object regex - ArgumentList " Mg" ).Replace($SplitFileName [0 ], " -Mg" , 1 )
50
50
$VariantName = $SplitFileName [1 ]
51
-
52
51
if ($_.DirectoryName -match " \\src\\(.*?.)\\" ) {
53
52
$ModuleName = ($CurrentApiVersion -eq " beta" ) ? " Beta.$ ( $Matches.1 ) " : $Matches.1
54
53
}
@@ -64,12 +63,12 @@ $ApiVersion | ForEach-Object {
64
63
$SegmentBuilder = " "
65
64
# Trim nested namespace segments.
66
65
$NestedNamespaceSegments = $Matches.1 -split " /"
67
- foreach ($Segment in $NestedNamespaceSegments ){
66
+ foreach ($Segment in $NestedNamespaceSegments ) {
68
67
# Remove microsoft.graph prefix and trailing '()' from functions.
69
- $Segment = $segment.Replace (" microsoft.graph." , " " ).Replace(" ()" , " " )
68
+ $Segment = $segment.Replace (" microsoft.graph." , " " ).Replace(" ()" , " " )
70
69
# Get resource object name from segment if it exists. e.g get 'updateAudience' from windowsUpdates.updateAudience
71
70
$ResourceObj = $Segment.Split (" ." )
72
- $Segment = $ResourceObj [$ResourceObj.Count - 1 ]
71
+ $Segment = $ResourceObj [$ResourceObj.Count - 1 ]
73
72
$SegmentBuilder += " /$Segment "
74
73
}
75
74
$Uri = $Uri -replace [Regex ]::Escape($MatchedUriSegment ), $SegmentBuilder
@@ -98,16 +97,16 @@ $ApiVersion | ForEach-Object {
98
97
$PermissionsResponse = Invoke-RestMethod - Uri " $ ( $PermissionsUrl ) ?requesturl=$ ( $MappingValue.Uri ) &method=$ ( $MappingValue.Method ) " - ErrorAction SilentlyContinue
99
98
$PermissionsResponse | ForEach-Object {
100
99
$Permissions += [PSCustomObject ]@ {
101
- Name = $_.value
102
- Description = $_.consentDisplayName
103
- FullDescription = $_.consentDescription
104
- IsAdmin = $_.IsAdmin
105
- ScopeType = $_.ScopeType
100
+ Name = $_.value
101
+ Description = $_.consentDisplayName
102
+ FullDescription = $_.consentDescription
103
+ IsAdmin = $_.IsAdmin
104
+ PermissionType = $_.ScopeType
106
105
IsLeastPrivilege = $_.isLeastPrivilege
107
106
}
108
107
}
109
108
$Permissions = $Permissions | Sort-Object - Property Name - Unique
110
- $Permissions = $Permissions | Sort-Object - Property ScopeType
109
+ $Permissions = $Permissions | Sort-Object - Property PermissionType
111
110
$Permissions = $Permissions | Sort-Object - Property IsLeastPrivilege
112
111
[array ]::Reverse($Permissions )
113
112
$MappingValue.Permissions = $Permissions
0 commit comments