Refactor the Oh My Posh profile
This commit is contained in:
parent
65a44675b2
commit
d4e2b633d5
1 changed files with 7 additions and 2 deletions
|
@ -5,8 +5,13 @@ param($context)
|
||||||
[Context] $context = $context;
|
[Context] $context = $context;
|
||||||
Write-Host "Configuring Oh My Posh!";
|
Write-Host "Configuring Oh My Posh!";
|
||||||
|
|
||||||
|
$createInvokation = {
|
||||||
|
param($initializer)
|
||||||
|
return "& ([scriptblock]::Create(($initializer) -join `"``n`"))";
|
||||||
|
}
|
||||||
|
|
||||||
$context.AddPowerShellProfileStatement(
|
$context.AddPowerShellProfileStatement(
|
||||||
"999_Oh My Posh",
|
"999_Oh My Posh",
|
||||||
@(
|
@(
|
||||||
'oh-my-posh init pwsh | Invoke-Expression;',
|
$createInvokation.Invoke("oh-my-posh init pwsh"),
|
||||||
"oh-my-posh completion powershell | Invoke-Expression;") -join [System.Environment]::NewLine);
|
$createInvokation.Invoke("oh-my-posh completion powershell")) -join [System.Environment]::NewLine);
|
||||||
|
|
Loading…
Reference in a new issue