Development snapshot 2026-10-25 (4.0.0-beta1 + fixes)

This commit is contained in:
Mikael Karlsson
2026-10-25 20:04:55 +11:00
parent 7869619510
commit 325e3a6b12
88 changed files with 21308 additions and 1081 deletions
+47
View File
@@ -352,6 +352,12 @@ function Initialize-UI {
Initialize-AvaloniaRuntime
}
# The menu item names what a click will do, so it follows the console state.
function Update-ConsoleWindowMenu {
$header = if (Get-ConsoleWindowVisible) { '_Hide console' } else { '_Show console' }
$script:UIProvider.SetXamlProperty($script:Window, 'mnuToggleConsole', 'Header', $header)
}
function Show-MainWindow {
param($View)
@@ -470,6 +476,19 @@ public static class IMMaximizeMetrics
try { $ui.ShowAboutDialog() } catch { Write-LogError "Show-AboutDialog failed" $_.Exception }
}))
# File > Hide console / Show console. Windows, classic console host only
# (Internal/ConsoleWindow.ps1); on macOS and Linux, and under Windows
# Terminal, there is nothing it could do, so the item is not shown.
if (Test-ConsoleWindowSupported) {
$ui.AddXamlEvent($script:Window, 'mnuToggleConsole', 'Add_Click', ({
try { [void](Switch-ConsoleWindow); Update-ConsoleWindowMenu } catch { Write-LogError "Toggle console failed" $_.Exception }
}))
Update-ConsoleWindowMenu
}
else {
$ui.SetXamlProperty($script:Window, 'mnuToggleConsole', 'IsVisible', $false)
}
$ui.AddXamlEvent($script:Window, 'mnuSettings', 'Add_Click', ({
try { Show-SettingsForm } catch { Write-LogError "Show-SettingsForm failed" $_.Exception }
}))
@@ -513,6 +532,18 @@ public static class IMMaximizeMetrics
# Stacks on top of the welcome modal on a first run off Windows, so the
# experimental warning is the first thing read and the first dismissed.
try { Show-ExperimentalPlatformNotice } catch { Write-LogError 'Show-ExperimentalPlatformNotice failed' $_.Exception }
# Setting HideConsoleWindow: hide the console once the window is up.
if ((Get-SettingValue "HideConsoleWindow") -eq $true -and (Test-ConsoleWindowSupported)) {
try { [void](Hide-ConsoleWindow); Update-ConsoleWindowMenu } catch { Write-LogError 'Hide-ConsoleWindow failed' $_.Exception }
}
}))
# Give the console back on exit: Start.cmd ends in `pause`, which would
# otherwise wait for a key in a window nobody can see.
$script:Window.add_Closed((ConvertTo-AvaloniaEventScriptBlock {
param($S, $E)
if ((Test-ConsoleWindowSupported) -and -not (Get-ConsoleWindowVisible)) { [void](Show-ConsoleWindow) }
}))
# Tell Windows this process is the Intune Management app so the taskbar
@@ -934,8 +965,13 @@ function Show-ReleaseNotes {
$remote = $null
$header = $null
$failure = $null
try {
$remote = Get-AppRemoteReleaseNotes
# Read straight after the call: Get-AppUpdateInfo below clears the recorded
# reason at its start, so asking later would report the version lookup's
# failure instead of this one.
if (-not $remote) { $failure = Get-AppUpdateLastError }
$info = Get-AppUpdateInfo
if ($info.IsOutdated) {
$header = "A newer version is available on GitHub: $($info.RemoteVersion.ToString()) (installed: $($info.LocalVersion.ToString()))"
@@ -947,6 +983,15 @@ function Show-ReleaseNotes {
catch { Write-LogError 'Failed to get release notes from GitHub' $_.Exception }
$body = if ($remote -and $remote.Text) { $remote.Text } else { $localNotes }
# Falling back to the local copy silently makes a rate-limited check look like the
# published notes simply match. Say which copy this is and why.
if (-not ($remote -and $remote.Text)) {
$note = if ($failure) { "Showing the local ReleaseNotes.md - could not read the published notes: $failure" }
else { 'Showing the local ReleaseNotes.md - could not read the published notes.' }
$header = if ($header) { $note + [Environment]::NewLine + $header } else { $note }
}
$content = if ($header) {
$header + [Environment]::NewLine + ('-' * 72) + [Environment]::NewLine + [Environment]::NewLine + $body
} else {
@@ -1422,6 +1467,8 @@ function Show-AboutDialog
}
$ui.SetXamlProperty($dlgAbout, 'txtTitle', 'Text', 'Intune Management')
# From the manifest (Internal/AppInfo.ps1), not the XAML - see the comment there.
$ui.SetXamlProperty($dlgAbout, 'txtCopyright', 'Text', (Get-AppCopyright))
if ($script:ActiveView) {
$ui.SetXamlProperty($dlgAbout, 'txtViewTitle', 'Text', ("Current view: " + $script:ActiveView.Title))
if ($script:ActiveView.Description) {
@@ -189,7 +189,18 @@ function Show-GraphBulkImportForm
Write-Status ""
$unknownNote = Get-IntuneUnknownSelectorSummary $summary.UnknownSelectors
if ($totalImported -eq 0) {
$approvalNote = Get-MSGraphApprovalPendingSummary $summary.PendingApproval
if ($approvalNote) {
# Held writes are queued, not failed - "no objects were imported,
# verify the folder" would send the user looking for a non-problem.
$msg = $approvalNote
if ($totalImported -gt 0) { $msg = ("Imported {0} object(s) from:`n{1}`n`n{2}" -f $totalImported, $importFolder, $msg) }
if ($unknownNote) { $msg += "`n`n$unknownNote" }
$ui.ShowMessageBox($msg, "Bulk Import", "OK", "Information") | Out-Null
if ($totalImported -gt 0 -and $script:IntuneManagerSelectedObject) {
Invoke-IntuneActivateObject $script:IntuneManagerSelectedObject | Out-Null
}
} elseif ($totalImported -eq 0) {
$msg = "No objects were imported.`nVerify the import folder and exported files."
if ($unknownNote) { $msg += "`n`n$unknownNote" }
$ui.ShowMessageBox($msg, "Bulk Import", "OK", "Warning") | Out-Null
@@ -22,6 +22,34 @@
# Normalize-IntuneImportPolicyName) live in Internal/IntuneManager.ps1 and
# are shared with the WPF tree.
function Get-IntuneManagerImportExistingPolicies
{
# Candidates for the skip / update / replace match (#384). Two things hid
# existing objects from it: pages the view had not loaded yet, and the filter
# box - the grid shows the filtered subset of IntuneManagerAllRows. So: every
# loaded row, plus whatever Get-IntuneImportCandidates (Internal/IntuneManager.ps1)
# finds in Graph for these files. It never loads every page. Cached for the
# dialog: the import type changing does not change what exists.
param($ImportPolicies, [string]$ImportType, [bool]$SameTenant)
$rows = @()
if ($script:IntuneManagerAllRows) { $rows = $script:IntuneManagerAllRows }
elseif ($script:dgIntuneManagerObjects) { $rows = $script:dgIntuneManagerObjects.ItemsSource }
$loaded = @($rows | ForEach-Object {
if ($_ -and $_.Source) { $_.Source } else { $_ }
} | Where-Object { $_ })
if ($ImportType -eq 'alwaysImport') { return $loaded }
$files = @($ImportPolicies | Where-Object { $_ })
$allLoaded = -not $script:GraphPagingCache
$key = "$SameTenant|$allLoaded|$($loaded.Count)|" + (($files | ForEach-Object { "$($_.PolicyType.Id)/$($_.Id)/$($_.Name)" }) -join '|')
if ($script:_importCandidateCache -and $script:_importCandidateCache.Key -eq $key) { return $script:_importCandidateCache.Value }
$value = @(Get-IntuneImportCandidates -ImportPolicies $files -LoadedPolicies $loaded -ImportType $ImportType -SameTenant $SameTenant -AllLoaded:$allLoaded)
$script:_importCandidateCache = @{ Key = $key; Value = $value }
return $value
}
function Update-IntuneManagerImportMatch
{
# Operates on $script:_imImportFormState. Recomputes ImportAction /
@@ -34,12 +62,8 @@ function Update-IntuneManagerImportMatch
$importType = [string]$st.Settings.ImportType
$sameTenant = [bool]$st.Settings.SameTenant
$existing = @()
if ($script:dgIntuneManagerObjects) {
$existing = @($script:dgIntuneManagerObjects.ItemsSource | ForEach-Object {
if ($_ -and $_.Source) { $_.Source } else { $_ }
} | Where-Object { $_ })
}
$files = @($st.DG.ItemsSource | ForEach-Object { if ($_) { $_.Source } })
$existing = @(Get-IntuneManagerImportExistingPolicies -ImportPolicies $files -ImportType $importType -SameTenant $sameTenant)
foreach ($row in @($st.DG.ItemsSource)) {
if (-not $row -or -not $row.Source) { continue }
@@ -147,6 +171,8 @@ function Invoke-IntuneManagerImportLoad
function Show-IntuneManagerImportForm
{
# A new dialog looks candidates up afresh: an earlier import may have created some.
$script:_importCandidateCache = $null
$ui = $script:UIProvider
$policyTypes = Get-IntuneManagerSelectedPolicyTypes
@@ -368,12 +394,8 @@ function Invoke-IntuneManagerImportExecute
Update-IntuneManagerImportMatch
$script:_imImportFormState = $null
$existing = @()
if ($script:dgIntuneManagerObjects) {
$existing = @($script:dgIntuneManagerObjects.ItemsSource | ForEach-Object {
if ($_ -and $_.Source) { $_.Source } else { $_ }
} | Where-Object { $_ })
}
$allFiles = @($st.DG.ItemsSource | ForEach-Object { if ($_) { $_.Source } })
$existing = @(Get-IntuneManagerImportExistingPolicies -ImportPolicies $allFiles -ImportType $importType -SameTenant ([bool]$st.Settings.SameTenant))
$policiesToImport = @()
$updatedPolicies = @()
+4 -1
View File
@@ -30,7 +30,10 @@
<TextBlock Name="txtTitle" FontWeight="Bold" Margin="0,5,0,0"/>
<TextBlock Grid.Row="1" Text="(c) 2022 Mikael Karlsson - MIT License" Margin="0,5,0,0"/>
<!-- Text set from the module manifest's Copyright by Show-AboutDialog
(Get-AppCopyright). Do not hardcode a year here: this line read
"(c) 2022" in 2026 builds, and so did the WPF copy. -->
<TextBlock Grid.Row="1" Name="txtCopyright" Margin="0,5,0,0"/>
<StackPanel Grid.Row="2" Margin="0,5,0,0">
<StackPanel Orientation="Horizontal">
+1
View File
@@ -76,6 +76,7 @@
<Separator/>
<MenuItem Header="_Release Notes" Name="mnuUpdates"/>
<MenuItem Header="_About" Name="mnuAbout"/>
<MenuItem Header="_Hide console" Name="mnuToggleConsole"/>
<Separator/>
<MenuItem Header="_Exit" Name="mnuExit"/>
</MenuItem>
+8 -1
View File
@@ -58,6 +58,13 @@ function Add-CommonUISettings
-Description "Adds the organization name next to the login info on the menu bar" `
-Section "General"
# Windows only, and only for the classic console host; the menu item and
# this setting do nothing elsewhere (Internal/ConsoleWindow.ps1 explains).
# Read by the UI backends alone - the engine never consults it.
Add-SettingsObject -Title "Hide console window" -Key "HideConsoleWindow" -Type "Boolean" -DefaultValue $false `
-Description "Hide the console window the application was started from once the main window is showing. File > Hide console / Show console toggles it for the session. Windows only, and only for the classic console host: under Windows Terminal the console cannot be hidden and the menu item is not shown." `
-Section "General"
# ---- Intune section (list behavior) ----
Add-SettingsObject -Title "Get all pages" -Key "GetAllPages" -Type "Boolean" `
@@ -69,7 +76,7 @@ function Add-CommonUISettings
-DefaultValue $true -SubPath "IntuneManager" -Section "IntuneManager"
Add-SettingsObject -Title "Max characters per cell" -Key "ObjectListMaxCellLength" -Type "Int" `
-Description "With single-line values on, cut a cell's text at this many characters so one long description cannot push the other columns out of view. Hover the cell for the full text; sorting and the filter still use the whole value. 0 = no limit." `
-Description "With single-line values on, cut a cell's text at this many characters so one long description cannot push the other columns out of view. The Name column is never cut; it trims at the column edge. Hover the cell for the full text; sorting and the filter still use the whole value. 0 = no limit." `
-DefaultValue 50 -SubPath "IntuneManager" -Section "IntuneManager"
$viewMenuTypes = @(
+75 -17
View File
@@ -328,10 +328,26 @@ public class AppUserModelHelper {
}
catch { }
# Setting HideConsoleWindow: hide the console once the window is up.
if((Get-SettingValue "HideConsoleWindow") -eq $true -and (Test-ConsoleWindowSupported))
{
$script:window.Add_ContentRendered({
[void](Hide-ConsoleWindow)
Update-ConsoleWindowMenu
})
}
$script:window.ShowDialog() | Out-Null
}
}
# The menu item names what a click will do, so it follows the console state.
function Update-ConsoleWindowMenu
{
$header = if(Get-ConsoleWindowVisible) { "_Hide console" } else { "_Show console" }
$script:UIProvider.SetXamlProperty($script:window, "mnuToggleConsole", "Header", $header)
}
function Get-LogViewPanel
{
$viewPanel = $script:UIProvider.GetXamlObject(($script:AppUIRootFolder + "\Xaml\LogInfo.xaml"))
@@ -974,6 +990,20 @@ public class TaskbarIconKeeper {
$script:UIProvider.AddXamlEvent($script:window, "mnuTenantSettings", "Add_Click", { Show-SettingsForm -Tenant })
$script:UIProvider.AddXamlEvent($script:window, "mnuUpdates", "Add_Click", { Show-UpdatesDialog })
$script:UIProvider.AddXamlEvent($script:window, "mnuAbout", "Add_Click", { Show-AboutDialog })
# File > Hide console / Show console. Windows, classic console host only
# (Internal/ConsoleWindow.ps1); where it cannot work the item is not shown.
if(Test-ConsoleWindowSupported)
{
$script:UIProvider.AddXamlEvent($script:window, "mnuToggleConsole", "Add_Click", {
[void](Switch-ConsoleWindow)
Update-ConsoleWindowMenu
})
Update-ConsoleWindowMenu
}
else
{
$script:UIProvider.SetXamlProperty($script:window, "mnuToggleConsole", "Visibility", "Collapsed")
}
$script:UIProvider.AddXamlEvent($script:window, "mnuExit", "Add_Click", {
if([System.Windows.MessageBox]::Show("Are you sure you want to exit?", "Exit?", "YesNo", "Question") -eq "Yes")
{
@@ -1003,7 +1033,10 @@ public class TaskbarIconKeeper {
$script:window.Add_Closed({
$grdViewPanel = $script:window.FindName("grdViewPanel")
$grdViewPanel.Children.Clear()
})
# Give the console back on exit: Start.cmd ends in `pause`, which would
# otherwise wait for a key in a window nobody can see.
if((Test-ConsoleWindowSupported) -and -not (Get-ConsoleWindowVisible)) { [void](Show-ConsoleWindow) }
})
$script:window.add_Loaded({
$script:SplashScreen.Hide()
@@ -1793,6 +1826,8 @@ function Show-AboutDialog
}
$script:UIProvider.SetXamlProperty($script:dlgAbout, "txtTitle", "Text", "Intune Management")
# From the manifest (Internal/AppInfo.ps1), not the XAML - see the comment there.
$script:UIProvider.SetXamlProperty($script:dlgAbout, "txtCopyright", "Text", (Get-AppCopyright))
$script:UIProvider.SetXamlProperty($script:dlgAbout, "txtViewTitle", "Text", ("Current view: " + $script:ActiveView.Title))
if($script:ActiveView.Description)
{
@@ -1825,23 +1860,48 @@ function Show-UpdatesDialog
}
else {
$fileContent = [IO.File]::ReadAllText($localReleaseNotes)
try
{
$tmp = $fileContent.Replace("`r`n","`n")
$mystring = ("blob $($tmp.Length)`0" + $tmp)
$mystream = [IO.MemoryStream]::new([byte[]][char[]]$mystring)
$curHash = Get-FileHash -InputStream $mystream -Algorithm SHA1
}
finally
{
if($mystream) { $mystream.Dispose() }
}
# One implementation of the git blob sha, in Internal/AppUpdateCheck.ps1, shared
# with the raw fallback that has to compute the published sha itself. The copy
# that used to live here counted CHARACTERS for the length prefix and cast
# chars to bytes, so a single non-ASCII character in the notes produced a sha
# GitHub never reports and the two copies always read as different.
$curHash = [PSCustomObject]@{ Hash = Get-AppGitBlobSha $fileContent }
}
# Fetch via Internal/AppUpdateCheck.ps1 so both backends share one
# implementation (R10). Sha is the blob hash used below to decide whether the
# published notes differ from the local copy.
$content = Get-AppRemoteReleaseNotes
# The local notes are rendered whenever the file exists, independently of what
# GitHub returned. They used to be written only on the "remote OK but the shas
# differ" path, so any other outcome - notably a failed fetch - left the Local
# tab visible (it has no Visibility in the XAML, so it defaults to Visible) and
# completely empty.
if($fileContent)
{
Set-WpfMarkdownText $script:dlgUpdates.FindName("txtReleaseNotesLocal") $fileContent
}
if(-not $content)
{
# Say why, in the dialog. Get-AppRemoteReleaseNotes has already logged it, but
# a reader looking at an empty Release Notes tab has no reason to go to the log
# - and "unreachable" is the wrong conclusion when the real answer is a shared
# API rate limit that resets in an hour.
$reason = Get-AppUpdateLastError
$message = if($reason) { "Could not read the published release notes.`n`n$reason" }
else { "Could not read the published release notes. See the log for details." }
Set-WpfMarkdownText $script:dlgUpdates.FindName("txtReleaseNotes") $message
# Nothing to compare against, so neither verdict applies. Keep the local tab
# only when there is something in it.
$script:UIProvider.SetXamlProperty($script:dlgUpdates, "txtReleaseNotesMatch", "Visibility", "Collapsed")
$script:UIProvider.SetXamlProperty($script:dlgUpdates, "txtReleaseNotesNoMatch", "Visibility", "Collapsed")
$visibility = if($fileContent) { "Visible" } else { "Collapsed" }
$script:UIProvider.SetXamlProperty($script:dlgUpdates, "tabLocalReleaseNotes", "Visibility", $visibility)
}
if($content)
{
# Rendered rather than dumped as raw text: Set-WpfMarkdownText turns the
@@ -1861,12 +1921,10 @@ function Show-UpdatesDialog
}
elseif($content.sha -ne $curHash.Hash)
{
# ReleaseNotes.md not matching - show the local copy alongside.
# This used to write $fileContent into txtReleaseNotes, overwriting the
# GitHub notes with the local ones while the Local tab it had just made
# visible stayed empty. The local text belongs in txtReleaseNotesLocal.
# ReleaseNotes.md not matching - show the local copy alongside. The text
# itself is rendered once, above, for every outcome; this only decides
# that the tab is worth showing.
$script:UIProvider.SetXamlProperty($script:dlgUpdates, "tabLocalReleaseNotes", "Visibility", "Visible")
Set-WpfMarkdownText $script:dlgUpdates.FindName("txtReleaseNotesLocal") $fileContent
$script:UIProvider.SetXamlProperty($script:dlgUpdates, "txtReleaseNotesMatch", "Visibility", "Collapsed")
}
else
@@ -118,7 +118,18 @@ function Show-GraphBulkImportForm
-ImportType $importType
$unknownNote = Get-IntuneUnknownSelectorSummary $summary.UnknownSelectors
if($summary.Imported -eq 0)
$approvalNote = Get-MSGraphApprovalPendingSummary $summary.PendingApproval
if($approvalNote)
{
# Held writes are queued, not failed - "no objects were imported,
# verify the folder" would send the user looking for a non-problem.
$msg = $approvalNote
if($summary.Imported -gt 0) { $msg = "Imported $($summary.Imported) object(s).`n`n$msg" }
if($unknownNote) { $msg += "`n`n$unknownNote" }
$script:UIProvider.ShowMessageBox($msg, "Import", "OK", "Information") | Out-Null
if($summary.Imported -gt 0) { Invoke-IntuneActivateObject $script:IntuneManagerSelectedObject | Out-Null }
}
elseif($summary.Imported -eq 0)
{
$msg = "No objects were imported.`nVerify the import folder and exported files."
if($unknownNote) { $msg += "`n`n$unknownNote" }
+33 -2
View File
@@ -8,7 +8,8 @@ function Update-IntuneImportMatchInfo
$importType = $script:importForm.DataContext.ImportType
$sameTenant = $script:importForm.DataContext.SameTenant
$existingPolicies = @($script:dgIntuneManagerObjects.ItemsSource)
$files = @($script:DGObjectsToImport.ItemsSource | ForEach-Object { if($_) { $_.Object } })
$existingPolicies = Get-IntuneManagerImportExistingPolicies -ImportPolicies $files -ImportType $importType -SameTenant $sameTenant
foreach($item in @($script:DGObjectsToImport.ItemsSource)) {
if(-not $item -or -not $item.Object) { continue }
@@ -23,8 +24,36 @@ function Update-IntuneImportMatchInfo
try { $script:DGObjectsToImport.Items.Refresh() } catch { }
}
function Get-IntuneManagerImportExistingPolicies
{
# Candidates for the skip / update / replace match (#384). Two things hid
# existing objects from it: pages the view had not loaded yet, and the filter
# box - the grid binds a CollectionView, which only enumerates the rows it
# shows. So: the unfiltered backing collection, plus whatever
# Get-IntuneImportCandidates (Internal/IntuneManager.ps1) finds in Graph for
# these files. It never loads every page. Cached for the dialog: the import
# type changing does not change what exists.
param($ImportPolicies, [string]$ImportType, [bool]$SameTenant)
$source = $script:dgIntuneManagerObjects.ItemsSource
if($source -is [System.Windows.Data.CollectionView]) { $source = $source.SourceCollection }
$loaded = @($source | Where-Object { $_ })
if($ImportType -eq "alwaysImport") { return $loaded }
$files = @($ImportPolicies | Where-Object { $_ })
$allLoaded = -not $script:GraphPagingCache
$key = "$SameTenant|$allLoaded|$($loaded.Count)|" + (($files | ForEach-Object { "$($_.PolicyType.Id)/$($_.Id)/$($_.Name)" }) -join '|')
if($script:_importCandidateCache -and $script:_importCandidateCache.Key -eq $key) { return $script:_importCandidateCache.Value }
$value = @(Get-IntuneImportCandidates -ImportPolicies $files -LoadedPolicies $loaded -ImportType $ImportType -SameTenant $SameTenant -AllLoaded:$allLoaded)
$script:_importCandidateCache = @{ Key = $key; Value = $value }
return $value
}
function Show-IntuneManagerImportForm
{
# A new dialog looks candidates up afresh: an earlier import may have created some.
$script:_importCandidateCache = $null
$policyTypes = Get-IntuneManagerSelectedPolicyTypes
if(($policyTypes | Measure-Object).Count -eq 0) {
@@ -163,11 +192,13 @@ function Show-IntuneManagerImportForm
$updatedPolicies = @()
Update-IntuneImportMatchInfo
$allFiles = @($script:DGObjectsToImport.ItemsSource | ForEach-Object { if($_) { $_.Object } })
$existingPolicies = Get-IntuneManagerImportExistingPolicies -ImportPolicies $allFiles -ImportType $importType -SameTenant $script:importForm.DataContext.SameTenant
foreach ($selectedPolicy in @($selectedPolicies))
{
$importPolicy = $selectedPolicy.Object
$match = Resolve-IntuneImportUpdateTarget -ImportPolicy $importPolicy -ExistingPolicies $script:dgIntuneManagerObjects.ItemsSource -SameTenant $script:importForm.DataContext.SameTenant -ImportType $importType
$match = Resolve-IntuneImportUpdateTarget -ImportPolicy $importPolicy -ExistingPolicies $existingPolicies -SameTenant $script:importForm.DataContext.SameTenant -ImportType $importType
if($match.Action -eq "Update" -and $importType -eq "update")
{
+3 -1
View File
@@ -501,7 +501,9 @@ function Show-SelectedGraphPolicies
$bindingProp,$colHeader = $columnInfo.Split('=')
if(-not $colHeader) { $colHeader = $bindingProp.Split(".")[-1] }
$dgIntuneManagerObjects.Columns.Add((New-GridTextColumn -Path $bindingProp -Header $colHeader -FirstLineOnly:$firstLineOnly -MaxLength $maxCellLength))
# The Name column is exempt from the cap (Get-GridCellMaxLength, issue #437).
$cellMax = Get-GridCellMaxLength -Path $bindingProp -Default $maxCellLength
$dgIntuneManagerObjects.Columns.Add((New-GridTextColumn -Path $bindingProp -Header $colHeader -FirstLineOnly:$firstLineOnly -MaxLength $cellMax))
}
}
else {
+17
View File
@@ -98,6 +98,23 @@ public class FirstLineConverter : IValueConverter
# first line (capped at -MaxLength characters when that is above 0) and carries
# the full text as a tooltip. Sorting and the grid filter still use the
# underlying value: both read the binding path, not what is displayed.
# The character cap (setting ObjectListMaxCellLength) exists for long free-text
# cells - a store app description - so one value cannot widen its column until
# the others leave the screen. It must never apply to the column that identifies
# the row: with the default cap of 50, every policy name in a list that shares a
# long prefix ended in an ellipsis, whatever the column width (issue #437). The
# Name column is trimmed at its edge by TextTrimming instead, like any grid.
function Get-GridCellMaxLength
{
param(
[Parameter(Mandatory = $true)][string]$Path,
[int]$Default = 0
)
if($Path -eq 'Name') { return 0 }
return $Default
}
function New-GridTextColumn
{
param(
+4 -1
View File
@@ -18,7 +18,10 @@
<TextBlock Height="20" Name="txtTitle" FontWeight="Bold" Margin="0,5,0,0" />
<TextBlock Grid.Row="1" Text="(c) 2022 Mikael Karlsson - MIT License" Margin="0,5,0,0" />
<!-- Text set from the module manifest's Copyright by Show-AboutDialog
(Get-AppCopyright). Do not hardcode a year here: this line read
"(c) 2022" in 2026 builds, and so did the Avalonia copy. -->
<TextBlock Grid.Row="1" Name="txtCopyright" Margin="0,5,0,0" />
<TextBlock Grid.Row="2">
See
+1
View File
@@ -78,6 +78,7 @@
<Separator />
<MenuItem Header="_Release Notes" Name="mnuUpdates" />
<MenuItem Header="_About" Name="mnuAbout" />
<MenuItem Header="_Hide console" Name="mnuToggleConsole" />
<Separator />
<MenuItem Header="_Exit" Name="mnuExit" />
</MenuItem>