Skip to content

Upgrade to PowerShell 7#16075

Open
JunielKatarn wants to merge 7 commits intomicrosoft:mainfrom
jurocha-ms:pwsh
Open

Upgrade to PowerShell 7#16075
JunielKatarn wants to merge 7 commits intomicrosoft:mainfrom
jurocha-ms:pwsh

Conversation

@JunielKatarn
Copy link
Copy Markdown
Contributor

@JunielKatarn JunielKatarn commented Apr 30, 2026

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Why

PowerShell 7 offers multiple performance improvements over Windows PowerShell (5.1).

🔍 PowerShell 7.x vs Windows PowerShell 5.1 — Performance & Security

Dimension Windows PowerShell 5.1 PowerShell 7.x (incl. 7.6 LTS)
Runtime .NET Framework 4.x 【1-9d0dcf】 Modern .NET (Core → .NET 8/9/10) 【1-9d0dcf】
Performance (overall) Baseline performance ~2–3× faster for common operations (arrays, strings, module load) 【2-7415bb】
Parallel execution No native pipeline parallelism Native parallelism (ForEach-Object -Parallel) 【3-bc07e3】
Memory efficiency Less efficient (older runtime) Improved memory management and efficiency 【2-7415bb】
Module loading Slower Faster module loading 【2-7415bb】
Optimization level Limited (legacy runtime) Continuously optimized via modern .NET 【1-9d0dcf】
Security model (lifecycle) Maintenance mode (security fixes only) 【3-bc07e3】 Actively developed with ongoing improvements 【3-bc07e3】
Platform security baseline Older .NET + Windows-only stack Modern .NET with updated crypto, TLS, runtime security 【1-9d0dcf】
Update model Tied to Windows updates Independent updates (faster patching) 【4-202161】
Execution policy Independent config (often Restricted by default) 【5-d94a22】 Independent config (often RemoteSigned by default) 【5-d94a22】
Attack surface Includes legacy Windows-specific components Reduced legacy surface, more modern APIs 【3-bc07e3】

See https://techieramesh.com/devops/windows-automation/ps-5-1-vs-7-5-comparison/

What

  • Ensure PowerShell 7 is installed (NuGet package to reduce set up footprint on the developer's machine).
  • Replace all references to powershell.exe with pwsh.exe.

Testing

CI checks pass

Microsoft Reviewers: Open in CodeFlow

@JunielKatarn JunielKatarn marked this pull request as ready for review April 30, 2026 02:32
@JunielKatarn JunielKatarn requested review from a team as code owners April 30, 2026 02:32
@JunielKatarn JunielKatarn requested a review from a team April 30, 2026 02:33
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