Skip to content

Use v6 Should-* syntax in docs examples#415

Open
nohwnd wants to merge 1 commit into
mainfrom
nohwnd-update-should-syntax-examples
Open

Use v6 Should-* syntax in docs examples#415
nohwnd wants to merge 1 commit into
mainfrom
nohwnd-update-should-syntax-examples

Conversation

@nohwnd

@nohwnd nohwnd commented Jul 15, 2026

Copy link
Copy Markdown
Member

The getting started page and the usage docs still teach the classic Should -Be syntax. v6 recommends the new Should-* assertions, so the canonical examples should use them.

This converts the examples in quick-start and docs/usage/*. Pages that document the old syntax on purpose are left as they are: the classic, soft and custom assertion references, the migration guides, and the generated command reference under docs/commands.

A few conversions are not a plain rename:

  • Should -Contain becomes Should-ContainCollection (membership in a collection).
  • Should -InvokeVerifiable becomes Should-Invoke -Verifiable, and the Should -Invoke headings in mocking.mdx lose the space. The inbound anchor in breaking-changes-in-v5 is updated to match.
  • The failure output in quick-start now prints types, so Expected 8, but got 9. becomes Expected [int] 8, but got [int] 9., matching what v6 actually prints.

Verified the converted examples and the mappings against Pester 6.0.0.

The getting started page and usage docs taught the classic `Should -Be`
syntax. v6 recommends the new `Should-*` assertions, so convert the canonical
examples to them.

Pages that document the old syntax on purpose are left unchanged: the classic,
soft and custom assertion references, the migration guides, and the generated
command reference.

Some conversions are not a plain rename:
- `Should -Contain` -> `Should-ContainCollection`
- `Should -InvokeVerifiable` -> `Should-Invoke -Verifiable`, and the
  `Should -Invoke` headings lose the space (the inbound anchor in
  breaking-changes-in-v5 is updated to match)
- quick-start failure output now shows types, e.g. `Expected 8, but got 9.` ->
  `Expected [int] 8, but got [int] 9.`, to match what v6 prints

Verified the converted examples against Pester 6.0.0.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant