pwsh is the executable name for modern, cross-platform PowerShell, starting from PowerShell Core 6. It represents a significant evolution from the original Windows PowerShell.

The History of PowerShell and the Rise of pwsh

PowerShell was first released in 2006 as Windows PowerShell, a powerful scripting language and command-line shell for Windows, built on the .NET Framework. For years, it was exclusively a Windows tool.

A major shift occurred in 2016 when Microsoft announced PowerShell would become open-source and cross-platform. This led to the creation of PowerShell Core, built on .NET Core (now just .NET), which can run on Windows, macOS, and Linux. To differentiate this new version from its Windows-only predecessor, the executable was named pwsh.

PowerShell Core 6.0 was the first stable cross-platform release in 2018. The journey continued with PowerShell 7, which aimed to unify the PowerShell experience, replacing both PowerShell Core 6.x and the legacy Windows PowerShell 5.1.

New Features in pwsh (PowerShell 7) vs. Windows PowerShell 5.1

PowerShell 7 and later versions (pwsh) introduced many new features and improvements over the traditional Windows PowerShell 5.1:

  • Cross-Platform: The most significant change is that pwsh runs on Windows, macOS, and Linux, while Windows PowerShell is limited to Windows.
  • Performance: pwsh offers significant performance improvements, especially for common cmdlets like Group-Object and Sort-Object.
  • Parallelization: The ForEach-Object -Parallel feature allows for running scripts concurrently, which can dramatically speed up tasks.
  • New Operators: pwsh includes new operators like pipeline chain operators (&& and ||), null-conditional operators (?? and ??=), and a ternary operator (a ? b : c).
  • Improved Error Handling: A more structured error view makes it easier to diagnose and fix issues in scripts.
  • SSH-Based Remoting: You can now manage remote machines over SSH, which is essential in mixed-OS environments.
  • Docker Support: pwsh can be used in Docker containers.
  • Side-by-Side Installation: pwsh can be installed and run alongside the older Windows PowerShell 5.1 without any conflicts.
  • Open Source: Being open-source means a vibrant community contributes to its development on GitHub.