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