Skip to content

Commit

Permalink
Prefer pwsh.exe over powershell.exe in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
casey committed Jan 29, 2025
1 parent c157ea6 commit 61d2566
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
Expand All @@ -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
Expand Down Expand Up @@ -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!"
Expand Down
2 changes: 1 addition & 1 deletion examples/kitchen-sink.just
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 3 additions & 6 deletions examples/powershell.just
Original file line number Diff line number Diff line change
@@ -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!"
Expand Down

0 comments on commit 61d2566

Please sign in to comment.