mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-11-09 20:44:03 -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
|
||||
}
|
||||
|
||||
function Set-PoshContext {}
|
||||
function Set-PoshContext([bool]$originalStatus) {}
|
||||
|
||||
function Get-CleanPSWD {
|
||||
$pswd = $PWD.ToString()
|
||||
|
@ -388,7 +388,7 @@ Example:
|
|||
catch {}
|
||||
}
|
||||
|
||||
Set-PoshContext
|
||||
Set-PoshContext $script:ErrorCode
|
||||
}
|
||||
|
||||
function Update-PoshErrorCode {
|
||||
|
|
|
@ -58,7 +58,7 @@ This can be used to for example populate an environment variable with a specific
|
|||
<TabItem value="powershell">
|
||||
|
||||
```powershell
|
||||
function Set-EnvVar {
|
||||
function Set-EnvVar([bool]$originalStatus) {
|
||||
$env:POSH=$(Get-Date)
|
||||
}
|
||||
New-Alias -Name 'Set-PoshContext' -Value 'Set-EnvVar' -Scope Global -Force
|
||||
|
|
Loading…
Reference in a new issue