docs: centralize environment variables information

resolves #2082
This commit is contained in:
Jan De Dobbeleer 2022-04-15 20:49:27 +02:00 committed by Jan De Dobbeleer
parent 6d49363165
commit ae5a6f6136
3 changed files with 17 additions and 14 deletions

View file

@ -17,8 +17,24 @@ offers a few standard properties to work with.
- `.UserName`: `string` - the current user name
- `.HostName`: `string` - the host name
- `.Code`: `int` - the last exit code
## Environment variables
- `.Env.VarName`: `string` - Any environment variable where `VarName` is the environment variable name
:::tip
If you're using PowerShell, you can override a function to populate environment variables before the
prompt is rendered.
```powershell
function Set-EnvVar {
$env:POSH=$(Get-Date)
}
New-Alias -Name 'Set-PoshContext' -Value 'Set-EnvVar' -Scope Global -Force
```
:::
## Helper functions
- url: create a hyperlink to a website to open your default browser `{{ url .UpstreamIcon .UpstreamURL }}`

View file

@ -59,5 +59,5 @@ error). The `&&` functionality will join the output of the commands when success
- `.Output`: `string` - the output of the command.
[env]: /docs/environment
[env]: /docs/config-templates#environment-variables
[templates]: /docs/config-templates

View file

@ -19,19 +19,6 @@ Display text.
}
```
:::tip
If you're using PowerShell, you can override a function to populate environment variables before the
prompt is rendered.
```powershell
function Set-EnvVar {
$env:POSH=$(Get-Date)
}
New-Alias -Name 'Set-PoshContext' -Value 'Set-EnvVar' -Scope Global -Force
```
:::
## Template ([info][templates])
### Properties