Create common pwsh
installation script
This commit is contained in:
parent
0f7ff4a2a6
commit
4eab5617b3
3 changed files with 13 additions and 18 deletions
12
scripts/Common/Config/Oh My Posh/install.ps1
Normal file
12
scripts/Common/Config/Oh My Posh/install.ps1
Normal file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/pwsh
|
||||
. "$PSScriptRoot/../powershell/lib.ps1";
|
||||
|
||||
Add-PowerShellProfileStatement `
|
||||
-Category "oh-my-posh" `
|
||||
-Statement $(
|
||||
@(
|
||||
"# Oh My Posh!",
|
||||
$(Get-ScriptInitializer "oh-my-posh init pwsh"),
|
||||
$(Get-ScriptInitializer "oh-my-posh completion powershell")
|
||||
) -join [System.Environment]::NewLine
|
||||
)
|
|
@ -1,17 +0,0 @@
|
|||
#!/bin/pwsh
|
||||
param($context)
|
||||
. "$PSScriptRoot/../../Scripts/Context.ps1";
|
||||
|
||||
[Context] $context = $context;
|
||||
Write-Host "Configuring Oh My Posh!";
|
||||
|
||||
$createInvokation = {
|
||||
param($initializer)
|
||||
return ". ([scriptblock]::Create(($initializer) -join `"``n`"))";
|
||||
}
|
||||
|
||||
$context.AddPowerShellProfileStatement(
|
||||
"999_Oh My Posh",
|
||||
[string[]]@(
|
||||
$createInvokation.Invoke("oh-my-posh init pwsh"),
|
||||
$createInvokation.Invoke("oh-my-posh completion powershell")) -join [System.Environment]::NewLine);
|
|
@ -4,4 +4,4 @@ param($context);
|
|||
|
||||
[Context] $context = $context;
|
||||
winget install --accept-source-agreements --accept-package-agreements -s winget --scope machine -e --id JanDeDobbeleer.OhMyPosh;
|
||||
. "$PSScriptRoot/../../Config/Oh My Posh/Install.ps1" $context;
|
||||
. "$PSScriptRoot/../../../Common/Config/Oh My Posh/install.ps1";
|
||||
|
|
Loading…
Reference in a new issue