Prefer pwsh.exe over powershell.exe in documentation

This commit is contained in:
Casey Rodarmor 2025-01-29 13:44:41 -08:00
parent c157ea62a1
commit 61d2566c29
3 changed files with 7 additions and 10 deletions

View file

@ -103,7 +103,7 @@ Like PowerShell:
```just
# use PowerShell instead of sh:
set shell := ["powershell.exe", "-c"]
set shell := ["pwsh.exe", "-c"]
hello:
Write-Host "Hello, world!"
@ -120,7 +120,7 @@ list:
```
You can also set the shell using command-line arguments. For example, to use
PowerShell, launch `just` with `--shell powershell.exe --shell-arg -c`.
PowerShell, launch `just` with `--shell pwsh.exe --shell-arg -c`.
(PowerShell is installed by default on Windows 7 SP1 and Windows Server 2008 R2
S1 and later, and `cmd.exe` is quite fiddly, so PowerShell is recommended for
@ -1211,7 +1211,7 @@ an additional flag, often `-c`, to make them evaluate the first argument.
use `windows-shell`:
```just
set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]
set windows-shell := ["pwsh.exe", "-NoLogo", "-Command"]
hello:
Write-Host "Hello, world!"

View file

@ -1,5 +1,5 @@
set shell := ["sh", "-c"]
set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]
set windows-shell := ["pwsh.exe", "-NoLogo", "-Command"]
set allow-duplicate-recipes
set positional-arguments
set dotenv-load

View file

@ -1,18 +1,15 @@
# Cross platform shebang:
shebang := if os() == 'windows' {
'powershell.exe'
'pwsh.exe'
} else {
'/usr/bin/env pwsh'
}
# Set shell for non-Windows OSs:
set shell := ["powershell", "-c"]
set shell := ["pwsh", "-c"]
# Set shell for Windows OSs:
set windows-shell := ["powershell.exe", "-NoLogo", "-Command"]
# If you have PowerShell Core installed and want to use it,
# use `pwsh.exe` instead of `powershell.exe`
set windows-shell := ["pwsh.exe", "-NoLogo", "-Command"]
linewise:
Write-Host "Hello, world!"