From a2958aa5d92a23c56cc1548f7447502b814f4ea3 Mon Sep 17 00:00:00 2001 From: lbr Date: Mon, 11 Jul 2022 13:12:44 +0200 Subject: [PATCH] Add Powershell one line activation --- docs/basic-usage.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/basic-usage.md b/docs/basic-usage.md index 316be8799e1..55abdc9a9e1 100644 --- a/docs/basic-usage.md +++ b/docs/basic-usage.md @@ -133,14 +133,14 @@ in order for the subsequent commands to run from within the virtual environment. Alternatively, to avoid creating a new shell, you can manually activate the virtual environment by running `source {path_to_venv}/bin/activate` (`{path_to_venv}\Scripts\activate.ps1` on Windows PowerShell). To get the path to your virtual environment run `poetry env info --path`. -You can also combine these into a nice one-liner, `source $(poetry env info --path)/bin/activate` +You can also combine these into a nice one-liner, `source $(poetry env info --path)/bin/activate` (`. ( Join-Path -Path ( poetry env info --path ) -ChildPath "\Scripts\activate.ps1" )` on Windows PowerShell) To deactivate this virtual environment simply use `deactivate`. -| | POSIX Shell | Windows (PowerShell) | Exit/Deactivate | -| ----------------- | ----------------------------------------------- | ------------------------------------- | --------------- | -| New Shell | `poetry shell` | `poetry shell` | `exit` | -| Manual Activation | `source {path_to_venv}/bin/activate` | `{path_to_venv}\Scripts\activate.ps1` | `deactivate` | -| One-liner | `source $(poetry env info --path)/bin/activate` | | `deactivate` | +| | POSIX Shell | Windows (PowerShell) | Exit/Deactivate | +| ----------------- | ----------------------------------------------- | --------------------------------------------------------------------------- | --------------- | +| New Shell | `poetry shell` | `poetry shell` | `exit` | +| Manual Activation | `source {path_to_venv}/bin/activate` | `{path_to_venv}\Scripts\activate.ps1` | `deactivate` | +| One-liner | `source $(poetry env info --path)/bin/activate` | `. ( Join-Path -P ( poetry env info --path ) -Ch "\Scripts\activate.ps1" )` | `deactivate` | ### Version constraints