From fb2922519fa921fedcdf979c70d65bf7cf049441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jare=C5=A1?= Date: Thu, 9 Jul 2026 01:35:10 +0200 Subject: [PATCH] Update assertion-map.md for Should-Not-Throw syntax (#2248) --- skills/pester-should-migration/references/assertion-map.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skills/pester-should-migration/references/assertion-map.md b/skills/pester-should-migration/references/assertion-map.md index dd078f6d..04132770 100644 --- a/skills/pester-should-migration/references/assertion-map.md +++ b/skills/pester-should-migration/references/assertion-map.md @@ -124,7 +124,7 @@ New combinator assertions have no v5 equivalent but are handy in migrations: | `{ ... } \| Should -Throw 'msg'` | `{ ... } \| Should-Throw -ExceptionMessage 'msg'` | Param **renamed** from `-ExpectedMessage`. `-like` wildcards supported. | | `{ ... } \| Should -Throw -ErrorId 'X'` | `{ ... } \| Should-Throw -FullyQualifiedErrorId 'X'` | Param **renamed**. | | `{ ... } \| Should -Throw -ExceptionType ([T])` | `{ ... } \| Should-Throw -ExceptionType ([T])` | Same. | -| `{ ... } \| Should -Not -Throw` | `{ ... }; ` | There is no `Should-NotThrow`; a script block that must not throw simply runs. Assert on its result instead, or keep the classic `Should -Not -Throw`. | +| `{ ... } \| Should -Not -Throw` | `& { ... }; ` | There is no `Should-NotThrow`; a script block that must not throw simply runs. Assert on its result instead, or keep the classic `Should -Not -Throw`. | `Should-Throw` adds `-AllowNonTerminatingError` and returns the error record for further assertions: `$err = { throw 'boom' } | Should-Throw; $err.Exception.Message | Should-BeString '*boom*'`.