mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 20:39:40 -08:00
parent
6d49363165
commit
ae5a6f6136
|
@ -17,8 +17,24 @@ offers a few standard properties to work with.
|
||||||
- `.UserName`: `string` - the current user name
|
- `.UserName`: `string` - the current user name
|
||||||
- `.HostName`: `string` - the host name
|
- `.HostName`: `string` - the host name
|
||||||
- `.Code`: `int` - the last exit code
|
- `.Code`: `int` - the last exit code
|
||||||
|
|
||||||
|
## Environment variables
|
||||||
|
|
||||||
- `.Env.VarName`: `string` - Any environment variable where `VarName` is the environment variable name
|
- `.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
|
## Helper functions
|
||||||
|
|
||||||
- url: create a hyperlink to a website to open your default browser `{{ url .UpstreamIcon .UpstreamURL }}`
|
- url: create a hyperlink to a website to open your default browser `{{ url .UpstreamIcon .UpstreamURL }}`
|
||||||
|
|
|
@ -59,5 +59,5 @@ error). The `&&` functionality will join the output of the commands when success
|
||||||
|
|
||||||
- `.Output`: `string` - the output of the command.
|
- `.Output`: `string` - the output of the command.
|
||||||
|
|
||||||
[env]: /docs/environment
|
[env]: /docs/config-templates#environment-variables
|
||||||
[templates]: /docs/config-templates
|
[templates]: /docs/config-templates
|
||||||
|
|
|
@ -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])
|
## Template ([info][templates])
|
||||||
|
|
||||||
### Properties
|
### Properties
|
||||||
|
|
Loading…
Reference in a new issue