mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-02-02 05:41:10 -08:00
feat(pwsh): pass original last execution status to Set-PoshContext for use in pwsh alias
This commit is contained in:
parent
b4e19adae1
commit
a43f57dd79
|
@ -113,7 +113,7 @@ New-Module -Name "oh-my-posh-core" -ScriptBlock {
|
||||||
$stdoutTask.Result
|
$stdoutTask.Result
|
||||||
}
|
}
|
||||||
|
|
||||||
function Set-PoshContext {}
|
function Set-PoshContext([bool]$originalStatus) {}
|
||||||
|
|
||||||
function Get-CleanPSWD {
|
function Get-CleanPSWD {
|
||||||
$pswd = $PWD.ToString()
|
$pswd = $PWD.ToString()
|
||||||
|
@ -388,7 +388,7 @@ Example:
|
||||||
catch {}
|
catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
Set-PoshContext
|
Set-PoshContext $script:ErrorCode
|
||||||
}
|
}
|
||||||
|
|
||||||
function Update-PoshErrorCode {
|
function Update-PoshErrorCode {
|
||||||
|
|
|
@ -58,7 +58,7 @@ This can be used to for example populate an environment variable with a specific
|
||||||
<TabItem value="powershell">
|
<TabItem value="powershell">
|
||||||
|
|
||||||
```powershell
|
```powershell
|
||||||
function Set-EnvVar {
|
function Set-EnvVar([bool]$originalStatus) {
|
||||||
$env:POSH=$(Get-Date)
|
$env:POSH=$(Get-Date)
|
||||||
}
|
}
|
||||||
New-Alias -Name 'Set-PoshContext' -Value 'Set-EnvVar' -Scope Global -Force
|
New-Alias -Name 'Set-PoshContext' -Value 'Set-EnvVar' -Scope Global -Force
|
||||||
|
|
Loading…
Reference in a new issue