◐ Shell
clean mode source ↗

Respect -UseWindowsPowerShell:$false in New-PSSession by yotsuda · Pull Request #26469 · PowerShell/PowerShell

@yotsuda

@daxian-dbw daxian-dbw added the CL-General

Indicates that a PR should be marked as a general cmdlet change in the Change Log

label

Nov 17, 2025

daxian-dbw

iSazonov

@yotsuda

iSazonov

- Adopt { ... } | Should -Not -Throw pattern as suggested by @mklement0
- Verify Transport is 'WSMan' (not 'Process') for -UseWindowsPowerShell:$false
- Simpler test that is independent of default PowerShell edition/version

iSazonov

1. Rename $session1 to $sessionWithTrue for better symmetry with $sessionWithFalse
2. Add null check for $sessionWithFalse to match the pattern used in Test 1

These changes improve test code readability and robustness.

iSazonov

iSazonov

@yotsuda yotsuda deleted the fix/new-pssession-usewindowspowershell-26464 branch

November 21, 2025 23:01

SIRMARGIN pushed a commit to SIRMARGIN/PowerShell that referenced this pull request

Dec 12, 2025

kilasuit pushed a commit to kilasuit/PowerShell that referenced this pull request

Jan 2, 2026

JustinGrote pushed a commit to JustinGrote/PowerShell that referenced this pull request

Jun 2, 2026