Skip to content

Commit

Permalink
Fix for sort alias
Browse files Browse the repository at this point in the history
  • Loading branch information
michevnew committed Jul 22, 2024
1 parent dd1ace7 commit 24d28b9
Show file tree
Hide file tree
Showing 21 changed files with 33 additions and 33 deletions.
6 changes: 3 additions & 3 deletions AADRolesInventory-Graph.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ foreach ($role in $roles) {
$role | Add-Member -MemberType NoteProperty -Name "Activated for" -Value $null
}

$role | Add-Member -MemberType NoteProperty -Name "Start time" -Value (&{if ($activeRole.startDateTime) {(Get-Date($activeRole.startDateTime | select -Unique | sort | select -First 1) -format g)} else {$null}})
$role | Add-Member -MemberType NoteProperty -Name "End time" -Value (&{if ($activeRole.endDateTime) {(Get-Date($activeRole.endDateTime | select -Unique | sort -Descending | select -First 1) -format g)} else {$null}})
$role | Add-Member -MemberType NoteProperty -Name "Start time" -Value (&{if ($activeRole.startDateTime) {(Get-Date($activeRole.startDateTime | select -Unique | Sort-Object | select -First 1) -format g)} else {$null}})
$role | Add-Member -MemberType NoteProperty -Name "End time" -Value (&{if ($activeRole.endDateTime) {(Get-Date($activeRole.endDateTime | select -Unique | Sort-Object -Descending | select -First 1) -format g)} else {$null}})
$role | Add-Member -MemberType NoteProperty -Name "AssignmentType" -Value (&{if ($activeRole.startDateTime) {"Eligible (Active)"} else {"Eligible"}})
}

Expand Down Expand Up @@ -222,7 +222,7 @@ foreach ($role in $roles) {
#endregion Output

#format and export
$report | sort PrincipalDisplayName #| Export-CSV -nti -Path "$((Get-Date).ToString('yyyy-MM-dd_HH-mm-ss'))_AzureADRoleInventory.csv"
$report | Sort-Object PrincipalDisplayName #| Export-CSV -nti -Path "$((Get-Date).ToString('yyyy-MM-dd_HH-mm-ss'))_AzureADRoleInventory.csv"
Write-Verbose "Output exported to $($PWD)\$((Get-Date).ToString('yyyy-MM-dd_HH-mm-ss'))_AzureADRoleInventory.csv"

#LIST all PAG
Expand Down
6 changes: 3 additions & 3 deletions AADRolesInventory-MG.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ foreach ($role in $roles) {
$role | Add-Member -MemberType NoteProperty -Name "Activated for" -Value $null
}

$role | Add-Member -MemberType NoteProperty -Name "Start time" -Value (&{if ($activeRole.startDateTime) {(Get-Date($activeRole.startDateTime | select -Unique | sort | select -First 1) -format g)} else {$null}})
$role | Add-Member -MemberType NoteProperty -Name "End time" -Value (&{if ($activeRole.endDateTime) {(Get-Date($activeRole.endDateTime | select -Unique | sort -Descending | select -First 1) -format g)} else {$null}})
$role | Add-Member -MemberType NoteProperty -Name "Start time" -Value (&{if ($activeRole.startDateTime) {(Get-Date($activeRole.startDateTime | select -Unique | Sort-Object | select -First 1) -format g)} else {$null}})
$role | Add-Member -MemberType NoteProperty -Name "End time" -Value (&{if ($activeRole.endDateTime) {(Get-Date($activeRole.endDateTime | select -Unique | Sort-Object -Descending | select -First 1) -format g)} else {$null}})
$role | Add-Member -MemberType NoteProperty -Name "AssignmentType" -Value (&{if ($activeRole.startDateTime) {"Eligible (Active)"} else {"Eligible"}})
}

Expand Down Expand Up @@ -145,7 +145,7 @@ foreach ($role in $roles) {
#endregion Output

#format and export
$report | sort PrincipalDisplayName #| Export-CSV -nti -Path "$((Get-Date).ToString('yyyy-MM-dd_HH-mm-ss'))_AzureADRoleInventory.csv"
$report | Sort-Object PrincipalDisplayName #| Export-CSV -nti -Path "$((Get-Date).ToString('yyyy-MM-dd_HH-mm-ss'))_AzureADRoleInventory.csv"
Write-Verbose "Output exported to $($PWD)\$((Get-Date).ToString('yyyy-MM-dd_HH-mm-ss'))_AzureADRoleInventory.csv"

#LIST all PAG
Expand Down
2 changes: 1 addition & 1 deletion AADRolesInventory.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ foreach ($AADRole in $AADRoles) {

#format and export
$report = foreach ($key in ($RolesHash.Keys)) { $RolesHash[$key] | % { [PSCustomObject]$_ } }
$report | sort DisplayName | Export-CSV -nti -Path "$((Get-Date).ToString('yyyy-MM-dd_HH-mm-ss'))_AzureADRoleInventory.csv"
$report | Sort-Object DisplayName | Export-CSV -nti -Path "$((Get-Date).ToString('yyyy-MM-dd_HH-mm-ss'))_AzureADRoleInventory.csv"
4 changes: 2 additions & 2 deletions DG_members_recursive.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ function Get-GroupMembershipReport {
#Get the list of members.
$users = Get-GroupMemberRecursive -Identity $GName.PrimarySmtpAddress.ToString() -RecursiveOutput:$RecursiveOutput -RecursiveOutputListGroups:$RecursiveOutputListGroups
#Filter out any duplicates and sort
$users = $users | sort Identifier -Unique
$users = $users | Sort-Object Identifier -Unique

#Prepare the output object.
$objProperties = New-Object PSObject
Expand All @@ -260,7 +260,7 @@ function Get-GroupMembershipReport {
}

#Output the result to the console host. Rearrange/sort as needed.
$arrGroupData | sort PrimarySmtpAddress
$arrGroupData | Sort-Object PrimarySmtpAddress
}

#Invoke the Get-GroupMembershipReport function and pass the command line parameters. Make sure the output is stored in a variable for reuse, even if not specified in the input!
Expand Down
4 changes: 2 additions & 2 deletions DG_members_recursiveV2.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ function Get-GroupMembershipReport {
#Get the list of members.
$members = Get-GroupMemberRecursive -Identity $GName.PrimarySmtpAddress -RecursiveOutput:$RecursiveOutput -RecursiveOutputListGroups:$RecursiveOutputListGroups
#Filter out any duplicates and sort
$members = $members | sort Identifier -Unique
$members = $members | Sort-Object Identifier -Unique

#Prepare the output object.
$objProperties = New-Object PSObject
Expand All @@ -302,7 +302,7 @@ function Get-GroupMembershipReport {
}

#Output the result to the console host. Rearrange/sort as needed.
$arrGroupData | sort PrimarySmtpAddress
$arrGroupData | Sort-Object PrimarySmtpAddress
}

#Invoke the Get-GroupMembershipReport function and pass the command line parameters. Make sure the output is stored in a variable for reuse, even if not specified in the input!
Expand Down
2 changes: 1 addition & 1 deletion GraphSDK_Bulk_change_service.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ foreach ($user in $users) {
foreach ($planToEnable in $plansToEnable) {
if ($planToEnable -notmatch "^[{(]?[0-9A-F]{8}[-]?([0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$") { $planToEnable = ($SKU.ServicePlans | ? {$_.ServicePlanName -eq "$planToEnable"}).ServicePlanId }
if (($planToEnable -in $SKU.ServicePlans.ServicePlanId) -and ($planToEnable -in $license.DisabledPlans)) {
$license.DisabledPlans = @($license.DisabledPlans | ? {$_ -ne $planToEnable} | sort -Unique)
$license.DisabledPlans = @($license.DisabledPlans | ? {$_ -ne $planToEnable} | Sort-Object -Unique)
$planToEnableName = ($Sku.servicePlans | ? {$_.ServicePlanId -eq "$planToEnable"}).servicePlanName #move out of the loop...
Write-Verbose "Toggled plan $planToEnable ($($planToEnableName)) from license $($license.SkuId) ($($SKU.skuPartNumber))"
}
Expand Down
2 changes: 1 addition & 1 deletion Graph_Bulk_change_service.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ foreach ($user in $users) {
foreach ($planToEnable in $plansToEnable) {
if ($planToEnable -notmatch "^[{(]?[0-9A-F]{8}[-]?([0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$") { $planToEnable = ($SKU.ServicePlans | ? {$_.ServicePlanName -eq "$planToEnable"}).ServicePlanId }
if (($planToEnable -in $SKU.ServicePlans.ServicePlanId) -and ($planToEnable -in $license.DisabledPlans)) {
$license.DisabledPlans = @($license.DisabledPlans | ? {$_ -ne $planToEnable} | sort -Unique)
$license.DisabledPlans = @($license.DisabledPlans | ? {$_ -ne $planToEnable} | Sort-Object -Unique)
$planToEnableName = ($Sku.servicePlans | ? {$_.ServicePlanId -eq "$planToEnable"}).servicePlanName #move out of the loop...
Write-Verbose "Toggled plan $planToEnable ($($planToEnableName)) from license $($license.SkuId) ($($SKU.skuPartNumber))"
}
Expand Down
2 changes: 1 addition & 1 deletion Graph_Flow_report.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ foreach ($flow in $flows) {
$flow | Add-Member -NotePropertyName Triggers -NotePropertyValue (processActions ($FlowDetails.properties.definitionSummary.triggers | select type,swaggerOperationId,@{n="api";e={$_.api.name}} -Unique))

#Reference resources
$flow | Add-Member -NotePropertyName Resources -NotePropertyValue (($FlowDetails.properties.referencedResources.service | sort -Unique) -join ";")
$flow | Add-Member -NotePropertyName Resources -NotePropertyValue (($FlowDetails.properties.referencedResources.service | Sort-Object -Unique) -join ";")

#Actions
$flow | Add-Member -NotePropertyName Actions -NotePropertyValue (processActions ($FlowDetails.properties.definitionSummary.actions | select type,swaggerOperationId,@{n="api";e={$_.api.name}} -Unique))
Expand Down
6 changes: 3 additions & 3 deletions Groups_Owner_Inventory.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ function Get-AzureADGroupOwnersInventory {
if (Get-Command Get-AzureADMSGroup -ErrorAction SilentlyContinue) {
Write-Host "Using the Azure AD Preview module." -ForegroundColor Cyan
$output = Get-AzureADMSGroup -All:$true | % { $_ | Add-Member "Owners" ((Get-AzureADGroupOwner -ObjectId $_.id).UserPrincipalName -join ";") -PassThru }
$output | sort DisplayName | select DisplayName,MailEnabled,SecurityEnabled,GroupTypes,Owners,@{n="ObjectId";e={$_.Id}}
$output | Sort-Object DisplayName | select DisplayName,MailEnabled,SecurityEnabled,GroupTypes,Owners,@{n="ObjectId";e={$_.Id}}
}
else {
Write-Host "Using the Azure AD module." -ForegroundColor Cyan
$output = Get-AzureADGroup -All:$true | % { $_ | Add-Member "Owners" ((Get-AzureADGroupOwner -ObjectId $_.ObjectId).UserPrincipalName -join ";") -PassThru }
$output | sort DisplayName | select DisplayName,MailEnabled,SecurityEnabled,Owners,ObjectId
$output | Sort-Object DisplayName | select DisplayName,MailEnabled,SecurityEnabled,Owners,ObjectId
}
}

Expand Down Expand Up @@ -66,7 +66,7 @@ function Get-ExchangeObjectsOwnersInventory {
}

#Return the output
$outputExchange | sort DisplayName | select DisplayName,MailEnabled,SecurityEnabled,ManagedBy,Owners,RecipientTypeDetails,@{n="ObjectId";e={$_.ExternalDirectoryObjectId}}
$outputExchange | Sort-Object DisplayName | select DisplayName,MailEnabled,SecurityEnabled,ManagedBy,Owners,RecipientTypeDetails,@{n="ObjectId";e={$_.ExternalDirectoryObjectId}}
}

#Get the Azure AD Owner report
Expand Down
4 changes: 2 additions & 2 deletions Groups_Owner_InventoryV2.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function Get-AzureADGroupOwnersInventory {
#If no objects are returned from the above cmdlet, stop the script and inform the user
if (!$output) { Write-Error "No group objects found" -ErrorAction Stop }

$output | sort DisplayName | select DisplayName,Id,Mail,MailEnabled,SecurityEnabled,GroupTypes,@{n="Owners";e={$_.Owners.AdditionalProperties.userPrincipalName -join ","}}
$output | Sort-Object DisplayName | select DisplayName,Id,Mail,MailEnabled,SecurityEnabled,GroupTypes,@{n="Owners";e={$_.Owners.AdditionalProperties.userPrincipalName -join ","}}
}

#Helper function for fetching ManagedBy data from Exchange Online
Expand Down Expand Up @@ -57,7 +57,7 @@ function Get-ExchangeObjectsOwnersInventory {
}

#Return the output
$outputExchange | sort DisplayName | select DisplayName,@{n="Id";e={$_.ExternalDirectoryObjectId}},PrimarySMTPAddress,MailEnabled,SecurityEnabled,ManagedBy,Owners,RecipientTypeDetails
$outputExchange | Sort-Object DisplayName | select DisplayName,@{n="Id";e={$_.ExternalDirectoryObjectId}},PrimarySMTPAddress,MailEnabled,SecurityEnabled,ManagedBy,Owners,RecipientTypeDetails
}

#Get the Azure AD Owner report
Expand Down
2 changes: 1 addition & 1 deletion Mobile_devices_inventory.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Helper function for loading the mailbox data. If no existing CSV file is found or it is outdated, the function will generate a new file (might take some time)...
function Load-MailboxMatchInputFile {
$importCSV = Get-ChildItem -Path $PSScriptRoot -Filter "*MailboxReport.csv" | sort LastWriteTime -Descending | select -First 1 #| select -ExpandProperty FullName
$importCSV = Get-ChildItem -Path $PSScriptRoot -Filter "*MailboxReport.csv" | Sort-Object LastWriteTime -Descending | select -First 1 #| select -ExpandProperty FullName

if (!$importCSV -or $importCSV.LastWriteTime -le (Get-Date).AddDays(-30)) {
#No CSV file detected or it's too old, generate new mailbox report
Expand Down
2 changes: 1 addition & 1 deletion Mobile_devices_inventoryV2.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function Check-Connectivity {

#Helper function for loading the mailbox data. If no existing CSV file is found or it is outdated, the function will generate a new file (might take some time)...
function Load-MailboxMatchInputFile {
$importCSV = Get-ChildItem -Path $PSScriptRoot -Filter "*MailboxReport.csv" | sort LastWriteTime -Descending | select -First 1 #| select -ExpandProperty FullName
$importCSV = Get-ChildItem -Path $PSScriptRoot -Filter "*MailboxReport.csv" | Sort-Object LastWriteTime -Descending | select -First 1 #| select -ExpandProperty FullName

if (!$importCSV -or $importCSV.LastWriteTime -le (Get-Date).AddDays(-30)) {
#No CSV file detected or it's too old, generate new mailbox report
Expand Down
2 changes: 1 addition & 1 deletion O365_aliases_inventoryV2.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ function Get-EmailAddressesInventory {
}
}
#Output the result to the console host. Rearrange/sort as needed.
$arrAliases | select * -ExcludeProperty Number | sort Aliases -Unique
$arrAliases | select * -ExcludeProperty Number | Sort-Object Aliases -Unique
}

#Invoke the Get-EmailAddressesInventory function and pass the command line parameters. Make sure the output is stored in a variable for reuse, even if not specified in the input!
Expand Down
2 changes: 1 addition & 1 deletion OU_report.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ foreach ($user in $Users) {
$arrOUs += $objUser
}

$arrOUs | select 'User Name',UserId,OU | sort OU | Export-CSV -nti -Path "$((Get-Date).ToString('yyyy-MM-dd_HH-mm-ss'))_O365UsersOUReport.csv"
$arrOUs | select 'User Name',UserId,OU | Sort-Object OU | Export-CSV -nti -Path "$((Get-Date).ToString('yyyy-MM-dd_HH-mm-ss'))_O365UsersOUReport.csv"
2 changes: 1 addition & 1 deletion OU_reportV2.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ foreach ($user in $Users) {
$arrOUs += $objUser
}

$arrOUs | select 'Display Name',UPN,OU | sort OU | Export-CSV -nti -Path "$((Get-Date).ToString('yyyy-MM-dd_HH-mm-ss'))_O365UsersOUReport.csv"
$arrOUs | select 'Display Name',UPN,OU | Sort-Object OU | Export-CSV -nti -Path "$((Get-Date).ToString('yyyy-MM-dd_HH-mm-ss'))_O365UsersOUReport.csv"
2 changes: 1 addition & 1 deletion Report_Team_Sites.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ Foreach ($Site in $Sites) {
$Report += $objSite
}

$Report | Sort Site | Export-Csv -Path "$((Get-Date).ToString('yyyy-MM-dd_HH-mm-ss'))_TeamsSprawlReport.csv" -NoTypeInformation -Encoding UTF8 -UseCulture
$Report | Sort-Object Site | Export-Csv -Path "$((Get-Date).ToString('yyyy-MM-dd_HH-mm-ss'))_TeamsSprawlReport.csv" -NoTypeInformation -Encoding UTF8 -UseCulture
2 changes: 1 addition & 1 deletion Role_assignments_Inventory.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,5 @@ if ($IncludeRoleGroups -and $IncludeUnassignedRoleGroups) {
$output #| Export-Csv -Path "$((Get-Date).ToString('yyyy-MM-dd_HH-mm-ss'))_RoleAssignments.csv" -NoTypeInformation -Encoding UTF8 -UseCulture

#Transform the output and return it to the console. Group assignments by individual user/group
$global:varRoleAssignments = $output | group Assignee | select @{n="DisplayName";e={($_.Group.AssigneeName | sort -Unique)}},@{n="Identifier";e={$_.Name}},@{n="ObjectType";e={($_.Group.AssigneeType | sort -Unique) -join ","}},@{n="AssignmentType";e={($_.Group.AssignmentType | sort -Unique) -join ","}},@{n="Roles";e={($_.Group.AssignedRoles | sort -Unique) -join ","}} | sort DisplayName
$global:varRoleAssignments = $output | group Assignee | select @{n="DisplayName";e={($_.Group.AssigneeName | Sort-Object -Unique)}},@{n="Identifier";e={$_.Name}},@{n="ObjectType";e={($_.Group.AssigneeType | Sort-Object -Unique) -join ","}},@{n="AssignmentType";e={($_.Group.AssignmentType | Sort-Object -Unique) -join ","}},@{n="Roles";e={($_.Group.AssignedRoles | Sort-Object -Unique) -join ","}} | Sort-Object DisplayName
$global:varRoleAssignments | ft
4 changes: 2 additions & 2 deletions SP_creds_remediate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ foreach ($SP in $SPs) {
#process application permissions entries
if (!$appRoleAssignments) { Write-Verbose "No application permissions to report on for SP $($SP.id), skipping..." }
else {
$objPermissions.'Last modified' = (Get-Date($appRoleAssignments.CreationTimestamp | select -Unique | sort -Descending | select -First 1) -format g)
$objPermissions.'Last modified' = (Get-Date($appRoleAssignments.CreationTimestamp | select -Unique | Sort-Object -Descending | select -First 1) -format g)

parse-AppPermissions $appRoleAssignments
$objPermissions.'Permissions (application)' = (($OAuthperm.GetEnumerator() | % { "$($_.Name):$($_.Value.ToString().TrimStart(','))"}) -join ";")
Expand All @@ -264,7 +264,7 @@ foreach ($SP in $SPs) {
else {
parse-DelegatePermissions $oauth2PermissionGrants
$objPermissions.'Permissions (delegate)' = (($OAuthperm.GetEnumerator() | % { "$($_.Name):$($_.Value.ToString().TrimStart(','))"}) -join ";")
$objPermissions.'Valid until (delegate)' = (Get-Date($oauth2PermissionGrants.ExpiryTime | select -Unique | sort -Descending | select -First 1) -format g)
$objPermissions.'Valid until (delegate)' = (Get-Date($oauth2PermissionGrants.ExpiryTime | select -Unique | Sort-Object -Descending | select -First 1) -format g)

if (($oauth2PermissionGrants.ConsentType | select -Unique) -eq "AllPrincipals") { $assignedto += "All users (admin consent)" }
$assignedto += @($OAuthperm.Keys) | % {if ($_ -match "\((.*@.*)\)") {$Matches[1]}}
Expand Down
2 changes: 1 addition & 1 deletion app_Permissions_inventory.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ foreach ($ServicePrincipal in $ServicePrincipals) {
Add-Member -InputObject $objPermissions -MemberType NoteProperty -Name "Homepage" -Value $ServicePrincipal.Homepage
Add-Member -InputObject $objPermissions -MemberType NoteProperty -Name "ObjectId" -Value $ServicePrincipal.ObjectId
Add-Member -InputObject $objPermissions -MemberType NoteProperty -Name "Enabled" -Value $ServicePrincipal.AccountEnabled
Add-Member -InputObject $objPermissions -MemberType NoteProperty -Name "Valid until" -Value ($SPperm.ExpiryTime | select -Unique | sort -Descending | select -First 1)
Add-Member -InputObject $objPermissions -MemberType NoteProperty -Name "Valid until" -Value ($SPperm.ExpiryTime | select -Unique | Sort-Object -Descending | select -First 1)

Write-Host $SPperm.Scope
$SPperm | % {#CAN BE DIFFERNT FOR DIFFERENT USERS!
Expand Down
4 changes: 2 additions & 2 deletions app_Permissions_inventory_GraphAPI.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ foreach ($SP in $SPs) {
#process application permissions entries
if (!$appRoleAssignments) { Write-Verbose "No application permissions to report on for SP $($SP.id), skipping..." }
else {
$objPermissions.'Last modified (application)' = (Get-Date($appRoleAssignments.CreationTimestamp | select -Unique | sort -Descending | select -First 1) -format g)
$objPermissions.'Last modified (application)' = (Get-Date($appRoleAssignments.CreationTimestamp | select -Unique | Sort-Object -Descending | select -First 1) -format g)

parse-AppPermissions $appRoleAssignments
$objPermissions.'Permissions (application)' = (($OAuthperm.GetEnumerator() | % { "$($_.Name):$($_.Value.ToString().TrimStart(','))"}) -join ";")
Expand All @@ -425,7 +425,7 @@ foreach ($SP in $SPs) {
else {
parse-DelegatePermissions $oauth2PermissionGrants
$objPermissions.'Permissions (delegate)' = (($OAuthperm.GetEnumerator() | % { "$($_.Name):$($_.Value.ToString().TrimStart(','))"}) -join ";")
$objPermissions.'Valid until (delegate)' = (Get-Date($oauth2PermissionGrants.ExpiryTime | select -Unique | sort -Descending | select -First 1) -format g)
$objPermissions.'Valid until (delegate)' = (Get-Date($oauth2PermissionGrants.ExpiryTime | select -Unique | Sort-Object -Descending | select -First 1) -format g)

if (($oauth2PermissionGrants.ConsentType | select -Unique) -eq "AllPrincipals") { $assignedto += "All users (admin consent)" }
$assignedto += @($OAuthperm.Keys) | % {if ($_ -match "\((.*@.*)\)") {$Matches[1]}}
Expand Down
Loading

0 comments on commit 24d28b9

Please sign in to comment.