Skip to content

Upgrade to PowerShell 7#16075

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

Upgrade to PowerShell 7#16075
JunielKatarn wants to merge 72 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 (see vnext/dotnet-tools.json). (NuGet package to reduce set up footprint on the developer's machine).
  • Replace most references to powershell.exe with pwsh.exe (except CMD and MSBuild files, for now).
  • Create package @react-native-windows/find-dotnet-tools to provide a common set of functions to determine PowerShell's (and potentially any other DotNet tool) location.
  • NOTE An issue was found when copying bundles. The resolved file system path could include a query string originally from the bundle's URI. This happens in all PR builds, so it's unrelated to this change.
    Sample error:
    error ENOENT: no such file or directory, mkdir 'D:\a\_work\1\s\packages\e2e-test-app-fabric\windows\RNTesterApp-Fabric\Bundle\assets?unstable_path=_@react-native-windows\tester\js\assets'.
    

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
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Performance Test Results

Branch: pwsh
Commit: 11b43bab
Time: 2026-05-07T02:34:42.471Z
Tests: 161/161 passed

✅ Passed

161 scenario(s) across 28 suite(s) — no regressions

SectionList

Scenario Mean Median StdDev Renders vs Baseline
SectionList mount 5.50ms 5.00ms ±1.72ms 1 +0.0%
SectionList unmount 0.40ms 0.00ms ±0.52ms 0 +0.0%
SectionList rerender 10.90ms 10.00ms ±1.85ms 2 -4.8%
SectionList with-3-sections-15-items 7.30ms 7.00ms ±2.36ms 1 +27.3%
SectionList with-5-sections-50-items 5.90ms 5.50ms ±1.52ms 1 -8.3%
SectionList with-10-sections-200-items 5.90ms 5.50ms ±1.52ms 1 +0.0%
SectionList with-20-sections-200-items 5.00ms 5.00ms ±1.70ms 1 +0.0%
SectionList with-section-separator 2.40ms 2.00ms ±2.01ms 1 +0.0%
SectionList with-item-separator 2.20ms 2.00ms ±0.79ms 1 +0.0%
SectionList with-header-footer 2.40ms 2.00ms ±1.65ms 1 +0.0%
SectionList with-section-footer 1.70ms 2.00ms ±0.48ms 1 +0.0%
SectionList with-sticky-section-headers 1.70ms 2.00ms ±0.48ms 1 +0.0%
SectionList with-empty-list 0.30ms 0.00ms ±0.48ms 1 -100.0%
SectionList with-50-sections-1000-items 1.30ms 1.00ms ±0.48ms 1 -50.0%

FlatList

Scenario Mean Median StdDev Renders vs Baseline
FlatList mount 4.90ms 4.00ms ±1.73ms 1 +0.0%
FlatList unmount 0.10ms 0.00ms ±0.32ms 0 +0.0%
FlatList rerender 10.20ms 10.00ms ±1.81ms 2 +11.1%
FlatList with-10-items 5.10ms 5.00ms ±1.10ms 1 +25.0%
FlatList with-100-items 5.00ms 5.00ms ±0.94ms 1 +0.0%
FlatList with-500-items 4.50ms 4.00ms ±1.35ms 1 +0.0%
FlatList with-1000-items 4.40ms 4.00ms ±0.52ms 1 +0.0%
FlatList horizontal 4.90ms 5.00ms ±1.79ms 1 +0.0%
FlatList with-separator 2.00ms 2.00ms ±0.00ms 1 +0.0%
FlatList with-header-footer 1.90ms 2.00ms ±1.20ms 1 +0.0%
FlatList with-empty-list 0.50ms 0.50ms ±0.53ms 1 +0.0%
FlatList with-get-item-layout 1.60ms 1.50ms ±0.70ms 1 +50.0%
FlatList inverted 1.60ms 2.00ms ±0.52ms 1 +33.3%
FlatList with-num-columns 3.40ms 3.00ms ±1.65ms 1 +0.0%

TouchableOpacity

Scenario Mean Median StdDev Renders vs Baseline
TouchableOpacity mount 0.90ms 1.00ms ±0.32ms 1 +0.0%
TouchableOpacity unmount 0.10ms 0.00ms ±0.32ms 0 +0.0%
TouchableOpacity rerender 1.00ms 1.00ms ±0.67ms 2 +0.0%
TouchableOpacity custom-active-opacity 0.80ms 1.00ms ±0.42ms 1 +0.0%
TouchableOpacity disabled 0.60ms 1.00ms ±0.52ms 1 +0.0%
TouchableOpacity with-all-handlers 0.70ms 1.00ms ±0.67ms 1 +0.0%
TouchableOpacity with-hit-slop 0.70ms 1.00ms ±0.48ms 1 +0.0%
TouchableOpacity with-delay 0.90ms 1.00ms ±1.20ms 1 +0.0%
TouchableOpacity nested 1.20ms 1.00ms ±0.42ms 1 +0.0%
TouchableOpacity multiple-10 6.00ms 6.00ms ±1.46ms 1 +0.0%
TouchableOpacity multiple-50 25.87ms 25.00ms ±2.80ms 1 -13.8%
TouchableOpacity multiple-100 37.40ms 43.00ms ±11.02ms 1 -14.0%

ScrollView

Scenario Mean Median StdDev Renders vs Baseline
ScrollView mount 0.30ms 0.00ms ±0.48ms 1 +0.0%
ScrollView unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
ScrollView rerender 0.50ms 0.50ms ±0.53ms 2 -50.0%
ScrollView children-20 3.53ms 3.00ms ±1.30ms 1 -25.0%
ScrollView children-100 16.60ms 15.00ms ±3.25ms 1 -6.3%
ScrollView horizontal 3.80ms 3.50ms ±1.23ms 1 -12.5%
ScrollView sticky-headers 3.10ms 3.00ms ±0.99ms 1 +0.0%
ScrollView scroll-indicators 0.80ms 1.00ms ±0.42ms 1 +0.0%
ScrollView nested 1.40ms 1.00ms ±0.70ms 1 +0.0%
ScrollView content-container-style 1.20ms 1.00ms ±1.03ms 1 +0.0%
ScrollView children-500 20.07ms 20.00ms ±3.03ms 1 +5.3%

TouchableHighlight

Scenario Mean Median StdDev Renders vs Baseline
TouchableHighlight mount 0.50ms 0.50ms ±0.53ms 1 +0.0%
TouchableHighlight unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
TouchableHighlight rerender 0.50ms 0.50ms ±0.53ms 2 -50.0%
TouchableHighlight custom-underlay-color 0.50ms 0.50ms ±0.53ms 1 +Infinity%
TouchableHighlight custom-active-opacity 0.30ms 0.00ms ±0.48ms 1 +0.0%
TouchableHighlight disabled 0.50ms 0.50ms ±0.53ms 1 +Infinity%
TouchableHighlight with-all-handlers 0.30ms 0.00ms ±0.48ms 1 +0.0%
TouchableHighlight with-hit-slop 0.30ms 0.00ms ±0.48ms 1 +0.0%
TouchableHighlight nested-touchables 1.00ms 1.00ms ±0.00ms 1 +0.0%
TouchableHighlight multiple-touchables-10 3.10ms 3.00ms ±1.10ms 1 +0.0%
TouchableHighlight multiple-touchables-50 13.90ms 13.00ms ±1.60ms 1 +4.0%
TouchableHighlight multiple-touchables-100 24.30ms 23.50ms ±3.27ms 1 +4.4%

Pressable

Scenario Mean Median StdDev Renders vs Baseline
Pressable mount 0.50ms 0.50ms ±0.53ms 1 +Infinity%
Pressable unmount 0.20ms 0.00ms ±0.42ms 0 +0.0%
Pressable rerender 0.60ms 1.00ms ±0.52ms 2 +100.0%
Pressable with-all-handlers 0.30ms 0.00ms ±0.48ms 1 +0.0%
Pressable with-style-function 0.30ms 0.00ms ±0.48ms 1 +0.0%
Pressable disabled 0.30ms 0.00ms ±0.48ms 1 +0.0%
Pressable with-hit-slop 0.20ms 0.00ms ±0.42ms 1 +0.0%
Pressable nested 0.80ms 1.00ms ±0.42ms 1 +0.0%
Pressable multiple-10 3.13ms 3.00ms ±0.52ms 1 +0.0%
Pressable multiple-50 15.87ms 15.00ms ±2.10ms 1 +7.1%
Pressable multiple-100 16.33ms 12.00ms ±10.04ms 1 +0.0%

Modal

Scenario Mean Median StdDev Renders vs Baseline
Modal mount 0.30ms 0.00ms ±0.48ms 1 +0.0%
Modal unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Modal rerender 0.20ms 0.00ms ±0.42ms 2 +0.0%
Modal slide-animation 0.30ms 0.00ms ±0.48ms 1 +0.0%
Modal fade-animation 0.20ms 0.00ms ±0.42ms 1 +0.0%
Modal transparent 0.40ms 0.00ms ±0.52ms 1 +0.0%
Modal with-callbacks 0.10ms 0.00ms ±0.32ms 1 +0.0%
Modal rich-content 1.40ms 1.00ms ±0.52ms 1 -50.0%
Modal with-accessibility 0.30ms 0.00ms ±0.48ms 1 +0.0%

Image

Scenario Mean Median StdDev Renders vs Baseline
Image mount 0.20ms 0.00ms ±0.42ms 1 +0.0%
Image unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Image rerender 0.20ms 0.00ms ±0.42ms 2 +0.0%
Image with-resize-mode 0.20ms 0.00ms ±0.42ms 1 +0.0%
Image with-border-radius 0.20ms 0.00ms ±0.42ms 1 +0.0%
Image with-tint-color 0.10ms 0.00ms ±0.32ms 1 +0.0%
Image with-blur-radius 0.20ms 0.00ms ±0.42ms 1 +0.0%
Image with-accessibility 0.10ms 0.00ms ±0.32ms 1 +0.0%
Image multiple-10 1.00ms 1.00ms ±0.00ms 1 +0.0%
Image multiple-50 3.73ms 4.00ms ±0.88ms 1 +33.3%
Image multiple-100 8.07ms 8.00ms ±1.28ms 1 +0.0%

ActivityIndicator

Scenario Mean Median StdDev Renders vs Baseline
ActivityIndicator mount 0.20ms 0.00ms ±0.42ms 1 +0.0%
ActivityIndicator unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
ActivityIndicator rerender 0.10ms 0.00ms ±0.32ms 2 +0.0%
ActivityIndicator size-large 0.20ms 0.00ms ±0.42ms 1 +0.0%
ActivityIndicator size-small 0.10ms 0.00ms ±0.32ms 1 +0.0%
ActivityIndicator with-color 0.20ms 0.00ms ±0.42ms 1 +0.0%
ActivityIndicator not-animating 0.20ms 0.00ms ±0.42ms 1 +0.0%
ActivityIndicator with-accessibility 0.20ms 0.00ms ±0.42ms 1 +0.0%
ActivityIndicator multiple-10 0.93ms 1.00ms ±0.26ms 1 +0.0%
ActivityIndicator multiple-50 3.87ms 4.00ms ±0.35ms 1 +0.0%
ActivityIndicator multiple-100 8.07ms 8.00ms ±1.49ms 1 +14.3%

Switch

Scenario Mean Median StdDev Renders vs Baseline
Switch mount 0.20ms 0.00ms ±0.42ms 1 +0.0%
Switch unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Switch rerender 0.40ms 0.00ms ±0.52ms 2 -100.0%
Switch value-true 0.20ms 0.00ms ±0.42ms 1 +0.0%
Switch disabled 0.30ms 0.00ms ±0.48ms 1 +0.0%
Switch custom-colors 0.30ms 0.00ms ±0.48ms 1 +0.0%
Switch on-value-change 0.20ms 0.00ms ±0.42ms 1 +0.0%
Switch with-accessibility 0.30ms 0.00ms ±0.48ms 1 +0.0%
Switch multiple-10 1.93ms 2.00ms ±1.22ms 1 +0.0%
Switch multiple-50 10.00ms 9.00ms ±2.39ms 1 +0.0%
Switch multiple-100 21.53ms 18.00ms ±6.48ms 1 +12.5%

Button

Scenario Mean Median StdDev Renders vs Baseline
Button mount 0.60ms 1.00ms ±0.52ms 1 +0.0%
Button unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Button rerender 1.00ms 1.00ms ±0.67ms 2 +0.0%
Button disabled 0.40ms 0.00ms ±0.52ms 1 -100.0%
Button with-color 0.50ms 0.50ms ±0.53ms 1 +0.0%
Button with-accessibility 0.60ms 1.00ms ±0.52ms 1 +0.0%
Button multiple-10 5.07ms 5.00ms ±0.70ms 1 -16.7%
Button multiple-50 21.47ms 24.00ms ±8.45ms 1 -11.1%
Button multiple-100 15.47ms 15.00ms ±2.23ms 1 -21.1%

TextInput

Scenario Mean Median StdDev Renders vs Baseline
TextInput mount 0.10ms 0.00ms ±0.32ms 1 +0.0%
TextInput unmount 0.10ms 0.00ms ±0.32ms 0 +0.0%
TextInput rerender 0.20ms 0.00ms ±0.42ms 2 +0.0%
TextInput multiline 0.00ms 0.00ms ±0.00ms 1 +0.0%
TextInput with-value 0.30ms 0.00ms ±0.48ms 1 +0.0%
TextInput styled 0.20ms 0.00ms ±0.42ms 1 +0.0%
TextInput multiple-100 7.67ms 8.00ms ±1.18ms 1 +14.3%

View

Scenario Mean Median StdDev Renders vs Baseline
View mount 0.10ms 0.00ms ±0.32ms 1 +0.0%
View unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
View rerender 0.10ms 0.00ms ±0.32ms 2 +0.0%
View nested-50 3.60ms 4.00ms ±0.51ms 1 +33.3%
View nested-100 8.13ms 8.00ms ±1.25ms 1 +14.3%
View shadow 0.20ms 0.00ms ±0.42ms 1 +0.0%
View border-radius 0.20ms 0.00ms ±0.42ms 1 +0.0%
View nested-500 17.47ms 11.00ms ±12.53ms 1 +10.0%

Text

Scenario Mean Median StdDev Renders vs Baseline
Text mount 0.10ms 0.00ms ±0.32ms 1 +0.0%
Text unmount 0.00ms 0.00ms ±0.00ms 0 +0.0%
Text rerender 0.10ms 0.00ms ±0.32ms 2 +0.0%
Text long-1000 0.20ms 0.00ms ±0.42ms 1 +0.0%
Text nested 0.20ms 0.00ms ±0.42ms 1 +0.0%
Text styled 0.10ms 0.00ms ±0.32ms 1 +0.0%
Text multiple-100 8.73ms 9.00ms ±1.53ms 1 +28.6%

SectionList.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
SectionList native mount 4.64ms 4.41ms ±0.69ms 1 -32.1%

FlatList.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
FlatList native mount 4.93ms 4.66ms ±1.05ms 1 -49.6%

TouchableHighlight.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
TouchableHighlight native mount 1.35ms 1.28ms ±0.21ms 1 -38.7%

TouchableOpacity.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
TouchableOpacity native mount 1.81ms 1.57ms ±0.69ms 1 -49.9%

Pressable.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Pressable native mount 1.38ms 1.34ms ±0.13ms 1 -46.8%

ScrollView.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
ScrollView native mount 3.20ms 3.08ms ±0.34ms 1 -23.9%

ActivityIndicator.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
ActivityIndicator native mount 1.47ms 1.28ms ±0.53ms 1 -48.4%

TextInput.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
TextInput native mount 2.33ms 2.22ms ±0.24ms 1 -45.7%

Switch.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Switch native mount 1.38ms 1.31ms ±0.23ms 1 -24.6%

Button.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Button native mount 1.83ms 1.77ms ±0.19ms 1 -31.9%

Modal.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Modal native mount 1.04ms 0.99ms ±0.23ms 1 -18.3%

Image.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Image native mount 1.83ms 1.71ms ±0.34ms 1 -24.2%

View.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
View native mount 1.05ms 0.98ms ±0.18ms 1 -31.6%

Text.native-perf-test.ts

Scenario Mean Median StdDev Renders vs Baseline
Text native mount 1.36ms 1.29ms ±0.19ms 1 -25.8%

Comment thread packages/@react-native-windows/find-dotnet-tools/src/findDotnetTools.ts Outdated
@JunielKatarn JunielKatarn marked this pull request as draft May 6, 2026 21:26
@JunielKatarn JunielKatarn marked this pull request as ready for review May 7, 2026 02:09
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