Issue 364 - Paging issues
Issue 367 - Login with App in UI
This commit is contained in:
Mikael Karlsson
2025-10-11 13:40:24 +11:00
parent 9bb966015e
commit 03b27b1775
3 changed files with 58 additions and 10 deletions
+27
View File
@@ -204,6 +204,7 @@ function Invoke-InitializeModule
Permissons=@("DeviceManagementConfiguration.ReadWrite.All")
Dependencies = @("ReusableSettings")
GroupId = "EndpointSecurity"
SupportsPageSize = $false
})
Add-ViewItem (New-Object PSObject -Property @{
@@ -217,6 +218,7 @@ function Invoke-InitializeModule
PostExportCommand = { Start-PostExportCompliancePolicies @args }
PreUpdateCommand = { Start-PreUpdateCompliancePolicies @args }
GroupId = "CompliancePolicies"
SupportsPageSize = $false
})
Add-ViewItem (New-Object PSObject -Property @{
@@ -264,6 +266,7 @@ function Invoke-InitializeModule
SkipRemoveProperties = @('Id') # Id is removed by PreImport. Required for default profile
PropertiesToRemoveForUpdate = @('isDefaultProfile','disableClientTelemetry')
GroupId = "TenantAdmin"
SupportsPageSize = $false
})
<#
@@ -291,6 +294,7 @@ function Invoke-InitializeModule
GroupId = "Azure"
SkipAddIDOnExport = $true
ExpandAssignmentsList = $false
SupportsPageSize = $false
})
Add-ViewItem (New-Object PSObject -Property @{
@@ -314,6 +318,7 @@ function Invoke-InitializeModule
AssignmentsType = "enrollmentConfigurationAssignments"
PropertiesToRemoveForUpdate = @('priority')
GroupId = "WinEnrollment"
SupportsPageSize = $false
})
Add-ViewItem (New-Object PSObject -Property @{
@@ -337,6 +342,7 @@ function Invoke-InitializeModule
AssignmentsType = "enrollmentConfigurationAssignments"
GroupId = "EnrollmentRestrictions"
ViewProperties = @("displayName","platformType","description","Id")
SupportsPageSize = $false
})
Add-ViewItem (New-Object PSObject -Property @{
@@ -352,6 +358,7 @@ function Invoke-InitializeModule
SkipRemoveProperties = @('Id')
GroupId = "WinEnrollment"
Icon = "EnrollmentStatusPage"
SupportsPageSize = $false
})
Add-ViewItem (New-Object PSObject -Property @{
@@ -428,6 +435,7 @@ function Invoke-InitializeModule
PreImportAssignmentsCommand = { Start-PreImportAssignmentsTermsAndConditions @args }
GroupId = "TenantAdmin"
ExpandAssignmentsList = $false
SupportsPageSize = $false
})
Add-ViewItem (New-Object PSObject -Property @{
@@ -448,6 +456,7 @@ function Invoke-InitializeModule
Dependencies = @("Applications")
GroupId = "AppProtection"
ExpandAssignmentsList = $false
SupportsPageSize = $false
})
# These are also included in the managedAppPolicies API
@@ -467,6 +476,7 @@ function Invoke-InitializeModule
Icon = "AppConfiguration"
GroupId = "AppConfiguration"
ExpandAssignmentsList = $false
SupportsPageSize = $false
})
Add-ViewItem (New-Object PSObject -Property @{
@@ -578,6 +588,7 @@ function Invoke-InitializeModule
Icon = "UpdatePolicies"
GroupId = "WinQualityUpdates"
PropertiesToRemoveForUpdate = @('releaseDateDisplayName','deployableContentDisplayName')
SupportsPageSize = $false
})
# Locations are not FULLY supported
@@ -648,6 +659,7 @@ function Invoke-InitializeModule
Permissons=@("DeviceManagementConfiguration.ReadWrite.All")
Icon="DeviceConfiguration"
GroupId = "DeviceConfiguration"
SupportsPageSize = $false
})
Add-ViewItem (New-Object PSObject -Property @{
@@ -778,6 +790,7 @@ function Invoke-InitializeModule
PreDeleteCommand = { Start-PreDeleteADMXFiles @args }
ViewProperties = @("fileName","status","Id")
PropertiesToRemove = @("languageCodes","targetPrefix","targetNamespace","policyType","revision","status","uploadDateTime")
SupportsPageSize = $false
})
<#
@@ -1058,7 +1071,14 @@ function Set-EMViewPanel
$global:btnLoadAllPages.add_click({
Write-Status "Loading $($global:curObjectType.Title) objects"
[array]$graphObjects = Get-GraphObjects -property $global:curObjectType.ViewProperties -objectType $global:curObjectType -AllPages
if(-not $global:dgObjects.Columns)
{
Show-GraphObjects -FromGraphObjects $graphObjects
}
else
{
$graphObjects | Where-Object { $_ -ne $null } | ForEach-Object { $global:dgObjects.ItemsSource.AddNewItem($_) | Out-Null }
}
$global:dgObjects.ItemsSource.CommitNew()
Set-GraphPagesButtonStatus
Invoke-FilterBoxChanged $global:txtFilter -ForceUpdate
@@ -1068,7 +1088,14 @@ function Set-EMViewPanel
$global:btnLoadNextPage.add_click({
Write-Status "Loading $($global:curObjectType.Title) objects"
[array]$graphObjects = Get-GraphObjects -property $global:curObjectType.ViewProperties -objectType $global:curObjectType -SinglePage
if(-not $global:dgObjects.Columns)
{
Show-GraphObjects -FromGraphObjects $graphObjects
}
else
{
$graphObjects | Where-Object { $_ -ne $null } | ForEach-Object { $global:dgObjects.ItemsSource.AddNewItem($_) | Out-Null }
}
$global:dgObjects.ItemsSource.CommitNew()
Set-GraphPagesButtonStatus
Invoke-FilterBoxChanged $global:txtFilter
+5
View File
@@ -1025,6 +1025,11 @@ function Connect-MSALUser
if($global:MainAppStarted -eq $false)
{
$script:AppLogin = (Get-SettingValue "GraphAzureAppLogin") -or ($global:TenantId -and $global:AzureAppId -and ($global:ClientSecret -or $global:ClientCert))
if((Get-SettingValue "GraphAzureAppLogin") -and -not $global:TenantId)
{
$global:TenantId = Get-SettingValue "GraphAzureTenantId"
}
}
if($script:AppLogin)
+19 -3
View File
@@ -245,6 +245,13 @@ function Invoke-InitializeModule
Description = "Login with specified app in the UI. Note: Change will require app restart"
}) "GraphSilent"
Add-SettingsObject (New-Object PSObject -Property @{
Title = "TenantId"
Key = "GraphAzureTenantId"
Type = "String"
Description = "Tenent Id used when logging in with App in UI"
}) "GraphSilent"
Add-SettingsObject (New-Object PSObject -Property @{
Title = "Refresh Objects after copy"
Key = "RefreshObjectsAfterCopy"
@@ -290,7 +297,7 @@ function Invoke-InitializeModule
Key = "GraphPageSize"
Type = "List"
ItemsSource = $script:lstGraphPageSize
DefaultValue = "20"
DefaultValue = "100"
Description = "How many items load at a time"
}) "GraphGeneral"
@@ -790,7 +797,7 @@ function Add-GraphObjectProperties
function Show-GraphObjects
{
param($filter, [switch]$ObjectTypeChanged)
param($filter, [switch]$ObjectTypeChanged, $FromGraphObjects)
$global:curObjectType = $global:lstMenuItems.SelectedItem
@@ -833,7 +840,9 @@ function Show-GraphObjects
if(-not $global:lstMenuItems.SelectedItem) { return }
if(-not $FromGraphObjects) {
Write-Status "Loading $($global:curObjectType.Title) objects"
}
if($global:lstMenuItems.SelectedItem.ShowForm -ne $false)
{
@@ -882,7 +891,12 @@ function Show-GraphObjects
$params.Add("SinglePage", $true)
}
if($FromGraphObjects) {
[array]$graphObjects = $FromGraphObjects
}
else {
[array]$graphObjects = Get-GraphObjects -property $global:curObjectType.ViewProperties -objectType $global:curObjectType -Filter $filter @params
}
$dgObjects.AutoGenerateColumns = $false
$dgObjects.Columns.Clear()
@@ -960,7 +974,9 @@ function Show-GraphObjects
}
else
{
$dgObjects.ItemsSource = $null
$ocList = [System.Collections.ObjectModel.ObservableCollection[object]]::new()
$dgObjects.ItemsSource = [System.Windows.Data.CollectionViewSource]::GetDefaultView($ocList)
#$dgObjects.ItemsSource = $null
}