Skip to content

Commit dbf1a67

Browse files
authored
Document where to put env definitions for non-Windows platforms (#11042)
1 parent 2e4be7e commit dbf1a67

4 files changed

Lines changed: 60 additions & 24 deletions

File tree

reference/7.2/Microsoft.PowerShell.Core/About/about_Environment_Variables.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,12 +314,21 @@ System Control Panel:
314314
## Create persistent environment variables on non-Windows platforms
315315

316316
Linux and macOS have configuration files and scripts that the operating system
317-
uses to set environment variables before starting an application. For example
318-
on Linux, you can add environment variables to the `/etc/environment` file or
319-
create a script that sets environment variables and put it in the
320-
`/etc/profile.d` folder. On macOS, you can add environment variables to the
321-
`/etc/zshrc` file. For more information, see the documentation for your
322-
operating system.
317+
uses to set environment variables before starting an application.
318+
319+
When running PowerShell as the default (login) shell, you can define
320+
environment variables in the global initialization files supported by the
321+
operating system. For example on Linux, you can add environment variables to
322+
the `/etc/environment` file or create a script that sets environment variables
323+
and put it in the `/etc/profile.d` folder. On macOS, you can add environment
324+
variables to the `/etc/profile` file.
325+
326+
When starting PowerShell from another shell, you can define environment
327+
variables in the shell-specific initialization files used by non-login shells,
328+
such as `~/.bashrc` for `bash` or `~/.zshrc` for `zsh`.
329+
330+
For more information, see the documentation for your operating system and
331+
default shell.
323332

324333
## PowerShell environment variables
325334

reference/7.3/Microsoft.PowerShell.Core/About/about_Environment_Variables.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,12 +314,21 @@ System Control Panel:
314314
## Create persistent environment variables on non-Windows platforms
315315

316316
Linux and macOS have configuration files and scripts that the operating system
317-
uses to set environment variables before starting an application. For example
318-
on Linux, you can add environment variables to the `/etc/environment` file or
319-
create a script that sets environment variables and put it in the
320-
`/etc/profile.d` folder. On macOS, you can add environment variables to the
321-
`/etc/zshrc` file. For more information, see the documentation for your
322-
operating system.
317+
uses to set environment variables before starting an application.
318+
319+
When running PowerShell as the default (login) shell, you can define
320+
environment variables in the global initialization files supported by the
321+
operating system. For example on Linux, you can add environment variables to
322+
the `/etc/environment` file or create a script that sets environment variables
323+
and put it in the `/etc/profile.d` folder. On macOS, you can add environment
324+
variables to the `/etc/profile` file.
325+
326+
When starting PowerShell from another shell, you can define environment
327+
variables in the shell-specific initialization files used by non-login shells,
328+
such as `~/.bashrc` for `bash` or `~/.zshrc` for `zsh`.
329+
330+
For more information, see the documentation for your operating system and
331+
default shell.
323332

324333
## PowerShell environment variables
325334

reference/7.4/Microsoft.PowerShell.Core/About/about_Environment_Variables.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,12 +314,21 @@ System Control Panel:
314314
## Create persistent environment variables on non-Windows platforms
315315

316316
Linux and macOS have configuration files and scripts that the operating system
317-
uses to set environment variables before starting an application. For example
318-
on Linux, you can add environment variables to the `/etc/environment` file or
319-
create a script that sets environment variables and put it in the
320-
`/etc/profile.d` folder. On macOS, you can add environment variables to the
321-
`/etc/zshrc` file. For more information, see the documentation for your
322-
operating system.
317+
uses to set environment variables before starting an application.
318+
319+
When running PowerShell as the default (login) shell, you can define
320+
environment variables in the global initialization files supported by the
321+
operating system. For example on Linux, you can add environment variables to
322+
the `/etc/environment` file or create a script that sets environment variables
323+
and put it in the `/etc/profile.d` folder. On macOS, you can add environment
324+
variables to the `/etc/profile` file.
325+
326+
When starting PowerShell from another shell, you can define environment
327+
variables in the shell-specific initialization files used by non-login shells,
328+
such as `~/.bashrc` for `bash` or `~/.zshrc` for `zsh`.
329+
330+
For more information, see the documentation for your operating system and
331+
default shell.
323332

324333
## PowerShell environment variables
325334

reference/7.5/Microsoft.PowerShell.Core/About/about_Environment_Variables.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,12 +314,21 @@ System Control Panel:
314314
## Create persistent environment variables on non-Windows platforms
315315

316316
Linux and macOS have configuration files and scripts that the operating system
317-
uses to set environment variables before starting an application. For example
318-
on Linux, you can add environment variables to the `/etc/environment` file or
319-
create a script that sets environment variables and put it in the
320-
`/etc/profile.d` folder. On macOS, you can add environment variables to the
321-
`/etc/zshrc` file. For more information, see the documentation for your
322-
operating system.
317+
uses to set environment variables before starting an application.
318+
319+
When running PowerShell as the default (login) shell, you can define
320+
environment variables in the global initialization files supported by the
321+
operating system. For example on Linux, you can add environment variables to
322+
the `/etc/environment` file or create a script that sets environment variables
323+
and put it in the `/etc/profile.d` folder. On macOS, you can add environment
324+
variables to the `/etc/profile` file.
325+
326+
When starting PowerShell from another shell, you can define environment
327+
variables in the shell-specific initialization files used by non-login shells,
328+
such as `~/.bashrc` for `bash` or `~/.zshrc` for `zsh`.
329+
330+
For more information, see the documentation for your operating system and
331+
default shell.
323332

324333
## PowerShell environment variables
325334

0 commit comments

Comments
 (0)