Skip to content

Commit 6027c8e

Browse files
authored
Add PowerShell snippets for postinstall (#22)
1 parent 290e92f commit 6027c8e

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

install-poetry.py

+15-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,21 @@ def _get_win_folder_with_ctypes(csidl_name):
269269
You can execute `set -U fish_user_paths {poetry_home_bin} $fish_user_paths`
270270
"""
271271

272-
POST_MESSAGE_CONFIGURE_WINDOWS = """"""
272+
POST_MESSAGE_CONFIGURE_WINDOWS = """
273+
You can choose and execute one of the following commands in PowerShell:
274+
275+
A. Append the bin directory to your user environment variable `PATH`:
276+
277+
```
278+
[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", "User") + ";{poetry_home_bin}", "User")
279+
```
280+
281+
B. Try to append the bin directory to PATH every when you run PowerShell (>=6 recommended):
282+
283+
```
284+
echo 'if (-not (Get-Command poetry -ErrorAction Ignore)) {{ $env:Path += ";{poetry_home_bin}" }}' | Out-File -Append $PROFILE
285+
```
286+
"""
273287

274288

275289
class PoetryInstallationError(RuntimeError):

0 commit comments

Comments
 (0)