Skip to content

Complete and standardize the PowerShell API surface - #186

Merged
PrzemyslawKlys merged 8 commits into
mainfrom
refactor/powershell-api-consistency
Aug 21, 2026
Merged

Complete and standardize the PowerShell API surface#186
PrzemyslawKlys merged 8 commits into
mainfrom
refactor/powershell-api-consistency

Conversation

@PrzemyslawKlys

@PrzemyslawKlys PrzemyslawKlys commented Aug 21, 2026

Copy link
Copy Markdown
Member

Summary

  • standardize source paths on Path, copy targets on DestinationPath, lifecycle opening on Open, and format-neutral PDF output through Export-OfficeDocumentPdf
  • make saved constructors, exporters, saves, and mutations quiet by default, with explicit -PassThru when callers need the saved file, result, or changed object
  • add discoverable New-Office*Options commands for PDF export/import, image export, HTML rendering, reader hierarchy, Word review, OpenDocument conversion, and email/mailbox workflows
  • complete native OpenDocument authoring for ODT, ODS, and ODP with both scriptblock DSL and pipeline/object composition commands
  • make Word image export support real single-page and multi-page output, including -AllPages, bounded PageCount batches, and PNG/SVG/JPEG/TIFF/WebP formats
  • align Word, Excel, PowerPoint, PDF, HTML, and Visio image export behavior and structured results
  • add end-to-end Mailozaurr and PSEventViewer integration recipes, regenerate command help and website artifacts, and document the PSWriteOffice/Mailozaurr ownership boundary

Breaking changes

  • canonical InputPath and FilePath parameters move to Path, except Export-OfficeDocumentPdf, where InputPath is the source and Path is the produced PDF
  • canonical lifecycle Show becomes Open; practical migration aliases remain where appropriate
  • saved New-*, Save-*, export, and mutation commands no longer emit values unless -PassThru is supplied
  • implicit PDF sidecars, constructor autosave behavior, and Get-OfficeWord / Get-OfficeExcel -AutoSave are removed in favor of explicit save and close operations
  • -Open is rejected with -NoSave because there is no saved artifact to open
  • advanced options should be created with the matching New-Office*Options command instead of guessed hashtables or direct .NET constructors

PowerShell usage

$markdown = New-OfficeMarkdownPdfOptions -ApplyWordLikeTheme -IncludeLocalImages
Export-OfficeDocumentPdf -InputPath .\Report.md -Path .\Report.pdf -MarkdownOptions $markdown

$image = New-OfficeWordImageOptions -PageIndex 0 -PageCount 2 -TargetDpi 144
Export-OfficeWordImage -Path .\Report.docx -OutputPath .\Pages -Format Webp -Options $image -PassThru

New-OfficeOpenDocument -Kind Spreadsheet -Path .\Status.ods -Content {
    Add-OfficeOpenDocumentSheet -Name Services -Content {
        Set-OfficeOpenDocumentCell -Row 0 -Column 0 -Value Service
        Set-OfficeOpenDocumentCell -Row 0 -Column 1 -Value Healthy
    }
}

Validation

  • .NET Framework 4.7.2 and .NET 8 source build: passed with 0 warnings and 0 errors
  • generated documentation parity: 527 Markdown command pages and 527 MAML commands
  • PowerShell 7 focused API/runtime suite: 34 passed, 0 failed
  • Windows PowerShell 5.1 focused API/runtime suite: 34 passed, 0 failed
  • complete 34-file packaged-module suite: 871 passed, 0 failed, 1 intentional skip
  • runtime format proof verifies Word and HTML JPEG, TIFF, and WebP payload signatures plus two-page Word batch output
  • public API tests reject undocumented option-object construction, nullable builder booleans, public Out-Null suppression patterns, and quiet-command pipelines without -PassThru
  • independent review and targeted remediation confirmation found no remaining P0-P2 issue in the reviewed API paths

@codecov-commenter

codecov-commenter commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 1.45%. Comparing base (5aadd5d) to head (be3238c).

Additional details and impacted files
@@          Coverage Diff           @@
##            main    #186    +/-   ##
======================================
  Coverage   1.45%   1.45%            
======================================
  Files        590     629    +39     
  Lines      34511   34419    -92     
  Branches    5485    5751   +266     
======================================
- Hits         503     502     -1     
+ Misses     33954   33863    -91     
  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: d54916ea20

ℹ️ 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/Pdf/ExportOfficeDocumentPdfCommand.cs Outdated
Comment thread Sources/PSWriteOffice/Cmdlets/Rtf/NewOfficeRtfPdfOptionsCommand.cs Outdated
@PrzemyslawKlys PrzemyslawKlys changed the title Standardize PowerShell paths, output, and PDF export Complete and standardize the PowerShell API surface Aug 21, 2026

@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: 721f0a7a19

ℹ️ 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/Pdf/ExportOfficeDocumentPdfCommand.cs Outdated
Comment thread Sources/PSWriteOffice/Cmdlets/Html/NewOfficeHtmlConversionOptionsCommand.cs Outdated
Comment thread Sources/PSWriteOffice/Cmdlets/Visio/NewOfficeVisioImageOptionsCommand.cs Outdated
@PrzemyslawKlys
PrzemyslawKlys merged commit 4f4be2c into main Aug 21, 2026
9 checks passed
@PrzemyslawKlys
PrzemyslawKlys deleted the refactor/powershell-api-consistency branch August 21, 2026 17:37
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