Skip to content

Modernize PowerShell DSL and parameter contracts - #187

Merged
PrzemyslawKlys merged 4 commits into
mainfrom
refactor/modern-powershell-surface
Aug 22, 2026
Merged

Modernize PowerShell DSL and parameter contracts#187
PrzemyslawKlys merged 4 commits into
mainfrom
refactor/modern-powershell-surface

Conversation

@PrzemyslawKlys

@PrzemyslawKlys PrzemyslawKlys commented Aug 21, 2026

Copy link
Copy Markdown
Member

Summary

  • add consistent OfficeWord, OfficeExcel, OfficePowerPoint, OfficePdf, OfficeMarkdown, OfficeRtf, OfficeVisio, and OfficeOpenDocument DSL roots while retaining the canonical New-Office* commands
  • replace closed string domains across Excel, Word, PowerPoint, PDF, Visio, AsciiDoc, and LaTeX with discoverable enum parameters
  • add validation and tab completion for extensible string domains, including named/hex colors, PDF styles, rich-text options, Markdown kinds, and reader assets
  • preserve Excel's established eight-digit #AARRGGBB contract while normalizing shorthand colors consistently across all Excel color parameters
  • make BackgroundColor None a portable rich-text reset for Word, PDF, and PowerPoint adapters; Excel safely ignores unsupported run backgrounds
  • keep native Visio line/fill patterns and gallery styles as bounded numeric identifiers rather than pretending they are stable enums
  • clarify and harden Visio stencil preview-gallery export, then refresh command help, examples, manifests, and website API artifacts
  • update OfficeIMO to 3.2.5, Microsoft.NET.Test.Sdk to 18.9.0, and xunit.runner.visualstudio to 4.0.0

PowerShell usage

OfficeVisio -Path '.\Service-Flow.vsdx' {
    VisioRectangle -Key request -Text 'Request' -FillColor CornflowerBlue
    VisioRectangle -Key approval -Text 'Approval' -FillColor '#FEF3C7'
    VisioConnector -From request -To approval -Kind Straight `
        -FromSide Right -ToSide Left -EndArrow Triangle
}

Existing New-Office* commands and established DSL aliases remain available. PowerShell still converts valid string literals to enum values, while invalid closed-domain values now fail during parameter binding. Open or renderer-extensible domains remain strings and receive completion without being artificially closed.

Validation

  • packaged module build with 527 Markdown/MAML command pages in parity
  • clean net8.0 and net472 builds
  • public API contract suite: 24 passed on PowerShell 7 and 24 on Windows PowerShell 5.1
  • defect-focused Excel color and cross-format rich-text checks: 5 passed on each PowerShell runtime
  • generated website documentation checks: 9 passed
  • independent read-only API review and review-storm closure audit completed; all validated P1/P2 findings were remediated and their defect classes swept

@codecov-commenter

codecov-commenter commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 314 lines in your changes missing coverage. Please review.
✅ Project coverage is 1.46%. Comparing base (4f4be2c) to head (2a4e6cd).

Files with missing lines Patch % Lines
...WriteOffice/Completion/OfficeArgumentCompleters.cs 0.00% 84 Missing ⚠️
.../PSWriteOffice/Services/Word/WordTextRunService.cs 0.00% 32 Missing ⚠️
...SWriteOffice/Services/Text/OfficeColorUtilities.cs 0.00% 22 Missing ⚠️
...ficePowerPointLayoutPlaceholderTextStyleCommand.cs 0.00% 9 Missing ⚠️
...o/ExportOfficeVisioStencilPreviewGalleryCommand.cs 0.00% 9 Missing ⚠️
...lets/Excel/AddOfficeExcelConditionalRuleCommand.cs 0.00% 8 Missing ⚠️
.../Excel/SetOfficeExcelColumnStyleByHeaderCommand.cs 0.00% 8 Missing ⚠️
...teOffice/Cmdlets/Word/AddOfficeWordTableCommand.cs 0.00% 8 Missing ⚠️
...Cmdlets/Word/SetOfficeWordParagraphStyleCommand.cs 0.00% 8 Missing ⚠️
Sources/PSWriteOffice/Cmdlets/OfficeLineEnding.cs 0.00% 7 Missing ⚠️
... and 46 more
Additional details and impacted files
@@          Coverage Diff           @@
##            main    #187    +/-   ##
======================================
  Coverage   1.45%   1.46%            
======================================
  Files        629     631     +2     
  Lines      34419   34293   -126     
  Branches    5751    5714    -37     
======================================
  Hits         502     502            
+ Misses     33863   33737   -126     
  Partials      54      54            

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0158b76352

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/PSWriteOffice/Completion/OfficeArgumentCompleters.cs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5fb6bf04e4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/PSWriteOffice/Cmdlets/Text/NewOfficeTextRunCommand.cs
@PrzemyslawKlys
PrzemyslawKlys merged commit 09a731e into main Aug 22, 2026
9 checks passed
@PrzemyslawKlys
PrzemyslawKlys deleted the refactor/modern-powershell-surface branch August 22, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants