@@ -48,7 +48,6 @@ $ApiVersion | ForEach-Object {
4848 $SplitFileName = $_.BaseName.Split (" _" )
4949 $CommandName = (New-Object regex - ArgumentList " Mg" ).Replace($SplitFileName [0 ], " -Mg" , 1 )
5050 $VariantName = $SplitFileName [1 ]
51-
5251 if ($_.DirectoryName -match " \\src\\(.*?.)\\" ) {
5352 $ModuleName = ($CurrentApiVersion -eq " beta" ) ? " Beta.$ ( $Matches.1 ) " : $Matches.1
5453 }
@@ -64,12 +63,12 @@ $ApiVersion | ForEach-Object {
6463 $SegmentBuilder = " "
6564 # Trim nested namespace segments.
6665 $NestedNamespaceSegments = $Matches.1 -split " /"
67- foreach ($Segment in $NestedNamespaceSegments ){
66+ foreach ($Segment in $NestedNamespaceSegments ) {
6867 # Remove microsoft.graph prefix and trailing '()' from functions.
69- $Segment = $segment.Replace (" microsoft.graph." , " " ).Replace(" ()" , " " )
68+ $Segment = $segment.Replace (" microsoft.graph." , " " ).Replace(" ()" , " " )
7069 # Get resource object name from segment if it exists. e.g get 'updateAudience' from windowsUpdates.updateAudience
7170 $ResourceObj = $Segment.Split (" ." )
72- $Segment = $ResourceObj [$ResourceObj.Count - 1 ]
71+ $Segment = $ResourceObj [$ResourceObj.Count - 1 ]
7372 $SegmentBuilder += " /$Segment "
7473 }
7574 $Uri = $Uri -replace [Regex ]::Escape($MatchedUriSegment ), $SegmentBuilder
@@ -98,16 +97,16 @@ $ApiVersion | ForEach-Object {
9897 $PermissionsResponse = Invoke-RestMethod - Uri " $ ( $PermissionsUrl ) ?requesturl=$ ( $MappingValue.Uri ) &method=$ ( $MappingValue.Method ) " - ErrorAction SilentlyContinue
9998 $PermissionsResponse | ForEach-Object {
10099 $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
106105 IsLeastPrivilege = $_.isLeastPrivilege
107106 }
108107 }
109108 $Permissions = $Permissions | Sort-Object - Property Name - Unique
110- $Permissions = $Permissions | Sort-Object - Property ScopeType
109+ $Permissions = $Permissions | Sort-Object - Property PermissionType
111110 $Permissions = $Permissions | Sort-Object - Property IsLeastPrivilege
112111 [array ]::Reverse($Permissions )
113112 $MappingValue.Permissions = $Permissions
0 commit comments