Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefer pwsh.exe over powershell.exe in documentation #2610

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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