Skip to content

Updates OCGV and SHOT to Terminal.Gui v2#267

Open
tig wants to merge 68 commits into
PowerShell:mainfrom
tig:terminal_gui_v2
Open

Updates OCGV and SHOT to Terminal.Gui v2#267
tig wants to merge 68 commits into
PowerShell:mainfrom
tig:terminal_gui_v2

Conversation

@tig
Copy link
Copy Markdown
Collaborator

@tig tig commented Nov 13, 2025

Updates OCGV and SHOT to Terminal.Gui v2

Ports Out-ConsoleGridView and Show-ObjectTree from Terminal.Gui v1 (1.17.1) to Terminal.Gui v2 (2.0.0). Also upgrades from .NET 8 to .NET 10.

Summary of Changes

Core Platform

  • Terminal.Gui v1 → v2: Complete rewrite of the UI layer against the v2 API. The old monolithic ConsoleGui.cs is replaced with focused window classes (OutGridViewWindow, ShowObjectTreeWindow).
  • .NET 8 → .NET 10: Updated global.json, TargetFramework, and all package references.
  • Build & project infrastructure: Added GraphicalTools.sln, Directory.Build.props, Directory.Packages.props, nuget.config, and tools/ for IDE support and dev environment setup.

Out-ConsoleGridView (ocgv)

  • Rebuilt using Terminal.Gui v2 TableView — native column headers, column sizing, horizontal scrolling, and multi-row selection. Replaces the old ListView-based implementation.
  • Streaming pipeline support — The UI appears on the first object and rows are added incrementally as the pipeline executes. A spinner in the status bar indicates loading is in progress.
  • Column sorting — Click column headers to sort ascending/descending (▲/▼ indicators).
  • -Search parameter — Positions cursor on the first matching row without hiding non-matching rows.
  • -Focus parameter — Controls whether the table or filter receives initial focus.
  • Improved TypeGetter — Now uses PowerShell format view definitions (.ps1xml), DefaultDisplayPropertySet, and property fallback in priority order. Properly handles ScriptBlock display entries, column type detection, and primitive types.
  • Regex-based filtering with real-time filter-as-you-type.
  • Ctrl+A / Ctrl+D — Select all / Deselect all keybindings.
  • Status bar with keyboard shortcuts and version info (in -Verbose/-Debug mode).

Show-ObjectTree (shot)

  • Rewritten UI using Terminal.Gui v2 TreeView with RegexTreeViewTextFilter.
  • Proper recursive object expansion with CachedMemberResult / CachedMemberResultElement for lazy-loaded tree nodes.

Tests

  • Added xUnit test project (Microsoft.PowerShell.ConsoleGuiTools.Tests) with 83 tests covering TypeGetter, DataTableColumn, DataTableRow, OutGridViewDataSource, Serializers, and OutGridViewWindow integration tests.
  • Added Pester test script (Microsoft.PowerShell.ConsoleGuiTools.Tests.ps1).

Documentation

  • Updated Out-ConsoleGridView.md to reflect all new features (streaming, sorting, Search, Focus, Ctrl+D).
  • Updated Show-ObjectTree.md to reflect current parameter set.
  • Updated README.md architecture section.

User Behavior Changes

New Parameters

Parameter Cmdlet(s) Description
-Driver ocgv, shot Sets the Terminal.Gui driver (ansi, windows, or unix). Defaults to ansi. Replaces -UseNetDriver. -ForceDriver is accepted as an alias.
-FullScreen ocgv, shot Runs in full-screen mode using the alternate screen buffer. By default, the app now renders inline (no alternate screen buffer).
-Search ocgv Positions cursor on first matching row (non-filtering).
-Focus ocgv Controls initial focus (Table or Filter).

Removed Parameters

Parameter Cmdlet(s) Notes
-UseNetDriver ocgv, shot Replaced by -Driver. Use -Driver windows for equivalent behavior.
-PassThru ocgv Was already removed in a prior release; doc references cleaned up. Use -OutputMode Multiple (the default).

Changed Behavior

  • Inline rendering by default — The app no longer takes over the full terminal with the alternate screen buffer. It renders inline in the current console. Use -FullScreen to get the old full-screen behavior.
  • TableView-based renderingOut-ConsoleGridView now uses Terminal.Gui's TableView control for proper column headers, column sizing, horizontal scrolling, and native selection. The old ListView-based approach is removed.
  • Streaming — Objects are streamed into the table as they arrive. The UI appears immediately on the first object.
  • Column sorting — Click column headers or use keyboard to sort.
  • Improved column detectionOut-ConsoleGridView now respects PowerShell format view definitions (.ps1xml files) for column headers and formatting. Objects like those from Get-NetAdapter now display the same columns as Format-Table.
  • Regex filtering — The filter box now uses regular expressions instead of simple string matching.
  • Enter with no selection — Pressing Enter without explicitly marking items returns the currently-focused row (previously returned nothing).
  • MinUI refinement-MinUI now hides the window frame, filter box, and status bar.

Removed Cmdlet

  • Out-ConsoleTableView (octv) — Merged into Out-ConsoleGridView. The OCTV implementation (TableView-based with streaming, sorting, etc.) is now the OCGV implementation. The octv alias is removed; use ocgv instead.

Fixes

tig added 2 commits November 12, 2025 17:42
WIP: Builds but doesn't run
Refactored `ConsoleGui.cs` to improve modularity, readability, and maintainability. Added dynamic layout handling, improved filtering logic, and enhanced status bar functionality. Simplified data loading and display string updates.

Updated `GridViewHelpers.cs` to handle nullable column widths and improve robustness.

Replaced `Terminal.Gui` package reference with a local project reference in `Microsoft.PowerShell.ConsoleGuiTools.csproj` to facilitate debugging. Added `<CopyLocalLockFileAssemblies>` for better build handling.

Added new launch profiles in `launchSettings.json` for streamlined debugging with preloaded `Out-ConsoleGridView` module.

Upgraded Visual Studio version in `GraphicalTools.sln` to 18.3.11206.111.
@tig
Copy link
Copy Markdown
Collaborator Author

tig commented Nov 13, 2025

Working.... -ish:

image

tig added 4 commits November 13, 2025 17:38
Enhanced the filtering functionality by introducing `_filterErrorView` to display filter-related errors and updated the `ApplyFilter` method to handle `RegexParseException` gracefully. Adjusted `_header` positioning dynamically based on `_filterErrorView` and ensured `ListView` selection defaults to the first item if none is selected.

Refactored `ListViewSource_MarkChanged` to handle null `_inputSource` safely. Simplified `StatusBar` creation and improved `filterErrorView` behavior with `Dim.Auto` for dynamic height and error-specific styling.

Updated `launchSettings.json` with new configurations (`OCGV -Filter`, `OCGV`, `OCGV -MinUi`) for better debugging flexibility. Cleaned up redundant code, improved null safety, and adjusted `Window` dimensions for `MinUI` mode.
Refactored `OnWinSubViewLayout` to add null checks for `_header`
to ensure safety and prevent runtime exceptions. Simplified
"Select All" and "Select None" logic by replacing manual
iteration with `_listView?.MarkAll` calls and added comments
to address a `Terminal.Gui` bug requiring explicit redraws.

Removed default `Ctrl-A` keybinding from `_listView` to allow
custom handling in the status bar. Updated `LangVersion` in
`Microsoft.PowerShell.ConsoleGuiTools.csproj` to `preview` to
enable preview language features. Fixed formatting in the
`ProjectReference` element for consistency.
Add SOT launch config and update Esc shortcut description

Added a new "SOT" launch configuration in `launchSettings.json`
to run the `Show-ObjectTree` command using PowerShell 7-preview.

Updated the "Esc" key shortcut description in `ShowObjectView.cs`
from `"~ESC~ Close"` to `"Close"` for improved clarity.
@tig tig changed the title Updates OCGV to Terminal.Gui v2 Updates OCGV and SOT to Terminal.Gui v2 Nov 14, 2025
tig added 11 commits November 14, 2025 10:00
Refactored `ConsoleGui` and `ShowObjectView` classes to improve readability, maintainability, and adherence to modern C# conventions. Key changes include:

- Updated `FILTER_LABEL` to `_Filter` for UI consistency.
- Simplified `ConsoleGui` initialization logic and removed redundant `SetNeedsDraw` call.
- Rewrote `ShowObjectView` to use nullable fields, modern syntax, and dynamic regex validation.
- Refactored `GetChildren` to handle nested objects with a `while` loop.
- Improved `CachedMemberResult` and `CachedMemberResultElement` with better encapsulation and naming conventions.
- Enhanced `RegexTreeViewTextFilter` with a primary constructor and better regex error handling.
- Simplified `Run` method in `ShowObjectView` for cleaner application lifecycle management.
- Fixed typos in comments and replaced redundant comments with concise explanations.
- General cleanup using modern C# features like expression-bodied methods, pattern matching, and `null`-coalescing operators.
Refactored namespaces to align with `Microsoft.PowerShell` conventions, replacing `OutGridView.Cmdlet` and `OutGridView.Models`. Updated the module version to `0.9.0` to reflect significant changes.

Improved code readability and maintainability by adding XML documentation, enforcing consistent naming conventions, and removing redundant code. Enhanced null safety with nullable annotations and null checks.

Refactored key classes (`ConsoleGui`, `GridViewDataSource`, `GridViewDetails`, `GridViewHelpers`, `OutConsoleGridviewCmdletCommand`, `ShowObjectTreeCmdletCommand`, etc.) to simplify logic, improve error handling, and ensure modern C# practices.

Updated `launchSettings.json` to rename the `SOT` profile to `SHOT` for consistency with the `Show-ObjectTree` cmdlet. Enhanced serialization logic in `Serializers.cs` and improved type handling in `TypeGetter.cs`.

These changes improve the maintainability, safety, and usability of the module while aligning with modern development standards.
Refactored the `ConsoleGui` class into a new class named `OutConsoleGridView` to improve modularity and maintainability. The `ConsoleGui` class was removed, and its functionality was moved to `OutConsoleGridView`, which is now implemented in a separate file (`OutConsoleGridView.cs`).

Updated all references to `ConsoleGui` in `OutConsoleGridViewCmdletCommand`:
- Replaced `_consoleGui` with `_outConsoleGridView`.
- Updated method calls to use `OutConsoleGridView` methods.
- Updated the `Dispose` method to dispose of `_outConsoleGridView`.

This change reorganizes the codebase for better readability and separation of concerns without introducing any functional changes.
The `Cmdlet` attribute for the `OutConsoleGridViewCmdletCommand` class
was updated to rename the cmdlet from `Out-ConsoleGridView` to
`ConsoleGridView`. This change simplifies the cmdlet name and may align
with a new naming convention.

The alias `[Alias("ocgv")]` remains unchanged, ensuring backward
compatibility for users familiar with the shorthand.
… unit testing.

Refactored `OutConsoleGridView` and `ShowObjectTree` for improved maintainability and performance:
- Introduced `OutGridViewWindow` and `ShowObjectTreeWindow` to encapsulate UI logic.
- Added `CachedMemberResult` and `CachedMemberResultElement` for better object hierarchy handling.
- Implemented `RegexTreeViewTextFilter` for regex-based filtering in tree views.

Enhanced data handling and UI:
- Replaced `DataTable` with direct `PSObjects` handling in `ApplicationData`.
- Improved grid view filtering, column width calculations, and status bar shortcuts.
- Enhanced tree view to display object hierarchies with filtering and status bar updates.

Refactored `TypeGetter`:
- Added caching for `FormatViewDefinition` lookups.
- Made `CastObjectsToTableView` static for reusability.

Updated dependencies and removed legacy code:
- Updated `Directory.Packages.props` to use `System.Management.Automation`.
- Removed redundant and outdated code from `OutConsoleGridView`.

Bug fixes and documentation:
- Fixed column width calculation issues and concurrency in `TypeGetter`.
- Improved error handling for invalid regex patterns.
- Added XML documentation for all new and modified classes.
Added a null check in `GetFormatViewDefinitionForObject` to handle cases where `typeName` is null, returning early if necessary. Introduced a caching mechanism using `_formatCache.TryGetValue` to improve performance by reusing cached format view definitions.

Refactored object-to-data-table conversion code for better readability by reformatting inline initializations of `DecimalValue` and `StringValue`.

Improved clarity in data type assignment logic by wrapping nested loops in braces and adopting modern C# syntax (`is not`) for type checks.
Updated `GetFormatViewDefinitionForType` to create a runspace with the default initial session state, ensuring proper loading of format data. Removed redundant fallback logic for `Get-FormatData` invocation. Added `Debug.Assert` to validate non-null results. Updated comments to reflect the new behavior. Included `System.Diagnostics` for debugging utilities.
Enhanced object formatting and display logic in the `Out-ConsoleGridView` cmdlet:
- Added `GetFormatDataForObjects` to retrieve format data for PowerShell objects.
- Updated `EndProcessing` to include format data in `ApplicationData`.
- Improved `DataTable` construction to use format data and added dynamic column formatting.
- Introduced `IsIdentifierProperty` to handle identifier-specific formatting.
- Added `FormatString` and `FormatValue` to `DataTableColumn` for flexible value formatting.
- Enhanced `IValue` interface with `OriginalValue` for raw data access.

Refactored `TypeGetter` to simplify format data retrieval and object-to-table conversion. Updated `launchSettings.json` to include new profiles and simplify commands.

Performed general code cleanup, removed legacy methods, and improved documentation for better maintainability.
Refactored `Render` method in `GridViewDataSource` to improve alignment handling. Enhanced column width management in `OutGridViewWindow` by introducing natural width calculations, truncation safeguards, and scrollbar support. Simplified layout handling with dynamic content size adjustments.

Removed deprecated `GetFormatDataForObjects` method and `FormatData` property, transitioning to dynamic column definitions using `TypeGetter`. Improved type handling with caching, ANSI escape sequence stripping, and better fallback logic for primitive types.

Updated launch configurations for testing new scenarios. Performed general code cleanup, improving readability, maintainability, and error handling.
Refactored the AddHeaders method to be an inline local function
within AddListView, improving modularity and encapsulation.
Removed the original AddHeaders implementation and its call
from the constructor. The new AddHeaders method is conditionally
invoked when _applicationData.MinUI is false.

Updated the Y positioning of _listView to use _filterErrorView
instead of _filterLabel. Adjusted _listView padding and scrollbar
position to integrate the header. Changed MARGIN_LEFT constant
from 1 to 0 to refine UI layout.
Add AllProperties toggle to Out-ConsoleGridView cmdlet

Introduced a new `AllProperties` parameter to the `Out-ConsoleGridView` cmdlet, allowing users to display all object properties instead of default display properties.

Key changes:
- Added `AllProperties` as a `SwitchParameter` in `OutConsoleGridViewCmdletCommand`.
- Updated `ApplicationData` to store the `AllProperties` state.
- Enhanced `OutGridViewWindow` with a `CheckBox` for toggling `AllProperties` and dynamic updates to the grid view and status bar.
- Added `ReloadDataWithAllProperties` and `UpdateStatusBar` methods to handle UI updates.
- Modified `TypeGetter` to support `AllProperties`, prioritizing format view definitions, default display property sets, and fallback to all properties.
- Updated `CastObjectsToTableView` to include an `allProperties` parameter.
- Improved compatibility with CIM instances by using the current runspace for format data retrieval.

These changes enhance the cmdlet's flexibility and usability, particularly for inspecting all object properties.
@tig tig changed the title Updates OCGV and SOT to Terminal.Gui v2 Updates OCGV and SHOT to Terminal.Gui v2 Nov 15, 2025
tig added 6 commits November 15, 2025 14:20
Refactored `OutConsoleGridViewCmdletCommand` and `OutGridViewWindow` classes for improved readability, maintainability, and performance. Introduced a new `Header` class for dynamic grid column headers with bold and underlined styles. Simplified logic, removed redundant methods, and optimized nullability handling.

Enhanced `TypeGetter` to filter out expensive `PS*` metadata properties, improving performance. Updated `ApplicationData` to clarify `AllProperties` behavior and removed unused imports.

Added a new launch configuration in `launchSettings.json` for testing the `-AllProperties` parameter. Improved status bar shortcuts and event handling for better user experience. Updated comments and documentation for consistency.
Updated the assignment of `dataTableColumns` to explicitly convert the result of `typeGetter.GetDataColumnsForObject` into a `List<DataTableColumn>` using `.ToList()`. This change ensures compatibility and enables list-specific operations, improving code clarity and robustness.
- Bump TargetFramework to net10.0 and update SDK to 10.0.101
- Switch NuGet source to nuget.org; comment out PowerShell feed
- Replace UseNetDriver with ForceDriver for driver selection
- Refactor app startup for Terminal.Gui 2.0 (IApplication, driver API)
- Update UI code for Terminal.Gui 2.0: focus, events, property names
- Add support for specifying driver (ansi, windows, unix) via cmdlet
- Modernize code with C# 12 features and improve nullability
- Standardize help text to "TUI" and clean up comments
- Update package references and launch settings for debugging
@Tweekism
Copy link
Copy Markdown

Hey mate, how are you building this at the moment? Using the Invoke-Build as per the main docs seems to build ok but I get this error trying to load the module.

Import-Module: Could not load file or assembly 'System.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

@tig
Copy link
Copy Markdown
Collaborator Author

tig commented Feb 13, 2026

I'm just using VS 2026. All the imvoke-build stuff got me confused, so I just ignored it as I'm developing. Happy for guidance.

@BDisp
Copy link
Copy Markdown

BDisp commented Feb 13, 2026

Probably is because PowerShell is targeting "version": "10.0.102" and the PR is targeting "version": "10.0.101".

- Click column header to sort ascending, click again to toggle descending
- Sort glyph (▲/▼) appended to sorted column header name
- Numeric-aware sorting (numbers sort by value, not lexicographically)
- Sorting composes with filter (filter applied first, then sort)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tig
Copy link
Copy Markdown
Collaborator Author

tig commented May 1, 2026

Sorting now works.

WindowsTerminal_xzUcIhsY7e

There's no keyboard UI for this (yet).

@tig
Copy link
Copy Markdown
Collaborator Author

tig commented May 1, 2026

This has reminded me that we are using OCGV -MinUI as a basic quick and dirty menu system. Which, uuuhhh... might not be the intended use case... 😅

Pro-tip: It's now trivial with TG to build apps that just pop any View. E.g. you could prompt an OptionSelector with those options. See

https://gui-cs.github.io/Terminal.Gui/docs/prompt.html

…iewWindow

OutTableViewDataSourceTests (27 tests):
- Construction, ColumnNames, indexer bounds checking
- AddRow including concurrent thread-safety test
- GetOriginalObjectIndex tracking
- Filter: empty/null returns self, regex matching, case-insensitive,
  cross-column, preserves original index, invalid regex throws
- Sort: ascending/descending, numeric-aware, preserves index,
  glyph indicators, invalid index returns self, no mutation of original

OutTableViewWindowIntegrationTests (22 tests):
- Rendering: headers, data, filter, MinUI
- ESC/close behavior
- Accept/selection: cursor row, multi-select, single mode, Ctrl+A
- Filter interaction: typing filters, Enter accepts from filter
- Focus: Table vs Filter targets
- Search: positions cursor, regex, no-match stays at top
- Streaming: OnDataChanged updates display, OnPipelineComplete
- Navigation: Home/End keys

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Tweekism
Copy link
Copy Markdown

Tweekism commented May 1, 2026

That has been on my To-Do list to have a look at, but I've been lazy and/or busy lol.

I also had a look at the Phyton Textual library 😋, but ugh Python... There is a MsGraph module for it, but Powershell is just so convenient for working with Microsoft Cloud services. And I don't really want to start all over again.

@tig
Copy link
Copy Markdown
Collaborator Author

tig commented May 1, 2026

This has reminded me that we are using OCGV -MinUI as a basic quick and dirty menu system. Which, uuuhhh... might not be the intended use case... 😅

Pro-tip: It's now trivial with TG to build apps that just pop any View. E.g. you could prompt an OptionSelector with those options. See

https://gui-cs.github.io/Terminal.Gui/docs/prompt.html

In fact, I actually built a sample app that does exactly what you want (./Examples/InlineSelect):

WindowsTerminal_nTbPubsjtV

@Tweekism
Copy link
Copy Markdown

Tweekism commented May 1, 2026

Ok sick! I'll have a look.

@andyleejordan
Copy link
Copy Markdown
Member

@tig let me know when to merge!

@tig tig marked this pull request as draft May 1, 2026 23:31
@tig
Copy link
Copy Markdown
Collaborator Author

tig commented May 1, 2026

@tig let me know when to merge!

Will do. Moved back to Draft for now.

- Delete old OCGV implementation files (GridViewDataSource, GridViewHelpers,
  GridViewRow, Header, OutConsoleGridviewCmdletCommand, OutConsoleGridView old)
- Rename OutConsoleTableViewCmdletCommand -> OutConsoleGridViewCmdletCommand
- Rename OutTableViewDataSource -> OutGridViewDataSource
- Rename OutTableViewWindow -> OutGridViewWindow
- Rename OutConsoleTableView -> OutConsoleGridView
- Update cmdlet attribute to [Cmdlet("ConsoleGridView")] with alias "ocgv"
- Rename -ForceDriver to -Driver with [Alias("ForceDriver")] for compat
- Add Ctrl+D deselect-all keybinding
- Update README, docs, launchSettings, and tests
- Delete Out-ConsoleTableView.md doc, update Out-ConsoleGridView.md with
  full feature set (streaming, sorting, Search, Focus parameters)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tig tig marked this pull request as ready for review May 4, 2026 18:35
@tig
Copy link
Copy Markdown
Collaborator Author

tig commented May 7, 2026

@andyleejordan FJYI - TG v2.1.0 is almost in the can. It has some breaking changes for TableView. Let's wait to ship the new release until I can update this PR. Ok?

tig and others added 3 commits May 8, 2026 06:49
Fix breaking change: TableSelection.Cursor renamed to TableSelection.SelectedCell.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2.1.0 stable is not published to the PowerShellCore_PublicPackages feed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The ADO feed requires auth for upstream packages not yet cached locally.
Adding nuget.org as a direct source so CI can resolve Terminal.Gui 2.1.0.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tig
Copy link
Copy Markdown
Collaborator Author

tig commented May 8, 2026

@andyleejordan I probably didn't do the nuget stuff right, but I wanted to verify ci/cd passed.

Other than that I think we're ready to launch!!

@the-mentor
Copy link
Copy Markdown

Is there a way to test this development branch?

@tig
Copy link
Copy Markdown
Collaborator Author

tig commented May 8, 2026

Is there a way to test this development branch?

git clone it

then Invoke-Build

then you can install the module. I'd run a clean shell first:

pwsh
Remove-Module -Verbose -Force Microsoft.PowerShell.ConsoleGuiTools
Import-Module -Verbose module/Microsoft.PowerShell.ConsoleGuiTools.dll
ls | ocgv

The test package bumps keep tripping a `MemberNotNullWhenAttribute`
`TypeLoadException` in seven `OutGridViewWindowIntegrationTests`, even
after clean restores. I pared this back to the updates that still pass
the full suite so we can land the PowerShell refresh without dragging in
the test host regression.

- `Microsoft.PowerShell.SDK` 7.5.4 -> 7.6.1
- `System.Management.Automation` 7.5.4 -> 7.6.1
- `global.json` SDK 10.0.101 -> 10.0.102

I tested with a full `dotnet clean`, `restore`, `build`, and `test`
run against `GraphicalTools.slnx`; all 83 tests pass.

Drafted by Copilot (GPT-5.5).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Member

@andyleejordan andyleejordan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the marathon on this one, @tig — and thanks @Tweekism and @BDisp for all the dev-cycle testing. The scope and quality of work here speaks for itself; I'm comfortable treating this as ready to ship with a couple of small housekeeping items, one of which I've already pushed.

Runtime/SDK package refresh — pushed as 15688a0. Since this PR was already moving the whole stack to .NET 10 + Terminal.Gui v2, I went ahead and added a commit on top with the safe set of bumps:

Package From To
Microsoft.PowerShell.SDK 7.5.4 7.6.1
System.Management.Automation 7.5.4 7.6.1
global.json SDK 10.0.101 10.0.102 (matches PowerShell/PowerShell)

All 83 tests pass locally with that set. Hope you don't mind the direct push — happy to revert if you'd rather take it yourself.

Test-tooling bumps — held back. I also tried bumping Microsoft.NET.Test.Sdk (17.12.0 → 17.14.1 / 18.5.1), xunit.runner.visualstudio (3.0.1 → 3.1.5), and coverlet.collector (6.0.4 → 10.0.1) together, but that consistently broke all 7 OutGridViewWindowIntegrationTests with System.TypeLoadException: ... Microsoft.TestPlatform.CoreUtilities, Version=15.0.0.0 ... MemberNotNullWhenAttribute. The currently-pinned versions work fine, so leaving them alone is the right call for this PR. Worth a follow-up issue at some point but not blocking. Newtonsoft.Json (13.0.4), xunit (2.9.3), and Terminal.Gui (2.1.0) are already on current stable.

One small security/cleanup ask (also called out inline on the two files): src/Microsoft.PowerShell.OutGridView.Models/Serializers.cs still carries its own BUGBUG: This appears to be unused code comment, and a repo-wide code search confirms it has no production callers — only the brand-new SerializersTests.cs references it. The class is public and uses TypeNameHandling.All, which is the textbook deserialization-gadget vector if any consumer of the OutGridView.Models assembly ever feeds it untrusted input. Rather than adding test coverage for it, I'd prefer we delete both Serializers.cs and SerializersTests.cs in this PR. Happy to push that commit too if it's easier.

Nothing else from me — the streaming + UI-thread coalescing pattern in OutConsoleGridView.AddObject / OnDataChanged reads cleanly, the OutGridViewDataSource lock discipline looks correct, and the regex filter/search paths handle RegexParseException in the right places. Once the Serializers removal lands, this is good to go from my side.

Drafted by Copilot (Claude Opus 4.7)

Comment thread src/Microsoft.PowerShell.OutGridView.Models/Serializers.cs
Comment thread test/Microsoft.PowerShell.ConsoleGuiTools.Tests/SerializersTests.cs
Comment thread nuget.config Outdated
…onfig

17.14.x is broken upstream by an unfixed regression:
microsoft/vstest#15075 throws TypeLoadException for
MemberNotNullWhenAttribute on Microsoft.TestPlatform.CoreUtilities
during assembly scanning. Terminal.Gui's ConfigurationManager runs
that scan from its static module initializer, so there is no in-process
workaround. Microsoft has closed the issue as 'not planned'; the
recommended workaround (skip TestPlatform assemblies during scanning)
is not reachable from user code.

Also drops the nuget.org source from nuget.config so all packages
flow through the PowerShellCore_PublicPackages CFS feed only;
ingestion of the new versions verified locally via interactive restore.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@andyleejordan
Copy link
Copy Markdown
Member

Follow-up on the package refresh — two more housekeeping commits on top of 15688a0:

10b3a8d — Pin Microsoft.NET.Test.Sdk at 17.13.0 and drop nuget.org from nuget.config.

Tried bumping Test.Sdk to 17.14.1 / 18.5.x; all 7 OutGridViewWindowIntegrationTests blow up at Terminal.Gui startup with System.TypeLoadException: ... MemberNotNullWhenAttribute ... Microsoft.TestPlatform.CoreUtilities, Version=15.0.0.0. Root cause is a known upstream regression: microsoft/vstest#15075, closed not_planned. The 17.14.x rebuild of CoreUtilities.dll dropped the MemberNotNullWhenAttribute polyfill, but sibling testhost assemblies still carry metadata references that resolve the attribute back to CoreUtilities. Terminal.Gui v2's ConfigurationManager runs its assembly scan from a static module initializer (.cctor), so nothing in user code — xunit fixtures, AppDomain.AssemblyResolve, TypeResolve — gets to install a filter before the scan throws. Microsoft's recommended workaround (skip TestPlatform assemblies during scanning) isn't reachable from our side. Net: 17.13.0 is the highest safe pin until either vstest 18.x stops referencing the polyfill or Terminal.Gui exposes a public hook for the scan. All 83 tests pass with this commit.

I also dropped nuget.org back out of nuget.config so all packages flow through the PowerShellCore_PublicPackages CFS feed only (per the policy we discussed back on April 30). Verified ingestion locally by clearing the NuGet cache and doing an interactive restore against CFS-only — every restored package's .nupkg.metadata now shows the Azure DevOps feed as the source.

Happy to revert either commit if you'd rather take these yourself.

Drafted by Copilot (Claude Opus 4.7)

@andyleejordan andyleejordan enabled auto-merge (squash) May 18, 2026 21:37
Copy link
Copy Markdown
Member

@andyleejordan andyleejordan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the extensive testing @tig I'll try to get this merged.

@andyleejordan
Copy link
Copy Markdown
Member

@tig ah but if you can clean up that dead code (and verify that it's really dead) that'd be great, then @SeeminglyScience can review (since I pushed commits, I can't approve!) 😄

@andyleejordan andyleejordan disabled auto-merge May 18, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment