Skip to content

Commit c0c6047

Browse files
pdgendtkartben
authored andcommitted
doc: develop: getting_started: Add powershell tabs
Activating the Python environment on Windows can be done in a regular command line prompt, or in powershell. But the activation script is different. Add a code tabs to include the powershell alternative. Signed-off-by: Pieter De Gendt <[email protected]>
1 parent d1969bf commit c0c6047

File tree

1 file changed

+44
-16
lines changed

1 file changed

+44
-16
lines changed

doc/develop/getting_started/index.rst

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ The current minimum required version for the main dependencies are:
160160

161161
Therefore, we don't recommend using WSL when getting started.
162162

163-
These instructions must be run in a ``cmd.exe`` command prompt terminal window.
164163
In modern version of Windows (10 and later) it is recommended to install the Windows Terminal
165-
application from the Microsoft Store. The required commands differ on PowerShell.
164+
application from the Microsoft Store. Instructions are provided for a ``cmd.exe`` or
165+
PowerShell command prompts.
166166

167167
These instructions rely on `Chocolatey`_. If Chocolatey isn't an option,
168168
you can install dependencies from their respective websites and ensure
@@ -175,8 +175,9 @@ The current minimum required version for the main dependencies are:
175175

176176
#. `Install chocolatey`_.
177177

178-
#. Open a ``cmd.exe`` terminal window as **Administrator**. To do so, press the Windows key,
179-
type ``cmd.exe``, right-click the :guilabel:`Command Prompt` search result, and choose
178+
#. Open a ``cmd.exe`` or PowerShell terminal window as **Administrator**.
179+
To do so, press the Windows key, type ``cmd.exe`` or PowerShell, right-click the
180+
:guilabel:`Command Prompt` or :guilabel:`PowerShell` search result, and choose
180181
:guilabel:`Run as Administrator`.
181182

182183
#. Disable global confirmation to avoid having to confirm the
@@ -333,20 +334,33 @@ chosen. You'll also install Zephyr's additional Python dependencies in a
333334
334335
.. group-tab:: Windows
335336

336-
#. Open a ``cmd.exe`` terminal window **as a regular user**
337+
#. Open a ``cmd.exe`` or PowerShell terminal window **as a regular user**
337338

338339
#. Create a new virtual environment:
339340

340-
.. code-block:: bat
341+
.. tabs::
342+
343+
.. code-tab:: bat
344+
345+
cd %HOMEPATH%
346+
python -m venv zephyrproject\.venv
341347

342-
cd %HOMEPATH%
343-
python -m venv zephyrproject\.venv
348+
.. code-tab:: powershell
349+
350+
cd $Env:HOMEPATH
351+
python -m venv zephyrproject\.venv
344352

345353
#. Activate the virtual environment:
346354

347-
.. code-block:: bat
355+
.. tabs::
348356

349-
zephyrproject\.venv\Scripts\activate.bat
357+
.. code-tab:: bat
358+
359+
zephyrproject\.venv\Scripts\activate.bat
360+
361+
.. code-tab:: powershell
362+
363+
zephyrproject\.venv\Scripts\Activate.ps1
350364

351365
Once activated your shell will be prefixed with ``(.venv)``. The
352366
virtual environment can be deactivated at any time by running
@@ -434,10 +448,17 @@ that are used to emulate, flash and debug Zephyr applications.
434448

435449
Install the Zephyr SDK using the ``west sdk install``.
436450

437-
.. code-block:: bat
451+
.. tabs::
438452

439-
cd %HOMEPATH%\zephyrproject\zephyr
440-
west sdk install
453+
.. code-tab:: bat
454+
455+
cd %HOMEPATH%\zephyrproject\zephyr
456+
west sdk install
457+
458+
.. code-tab:: powershell
459+
460+
cd $Env:HOMEPATH\zephyrproject\zephyr
461+
west sdk install
441462

442463
.. tip::
443464

@@ -485,10 +506,17 @@ Build the :zephyr:code-sample:`blinky` with :ref:`west build <west-building>`, c
485506
486507
.. group-tab:: Windows
487508

488-
.. code-block:: bat
509+
.. tabs::
510+
511+
.. code-tab:: bat
512+
513+
cd %HOMEPATH%\zephyrproject\zephyr
514+
west build -p always -b <your-board-name> samples\basic\blinky
515+
516+
.. code-tab:: powershell
489517

490-
cd %HOMEPATH%\zephyrproject\zephyr
491-
west build -p always -b <your-board-name> samples\basic\blinky
518+
cd $Env:HOMEPATH\zephyrproject\zephyr
519+
west build -p always -b <your-board-name> samples\basic\blinky
492520

493521
The ``-p always`` option forces a pristine build, and is recommended for new
494522
users. Users may also use the ``-p auto`` option, which will use

0 commit comments

Comments
 (0)