From 40788f3d98f0de306ca2540ad64c5212fc90f096 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 27 Jul 2023 02:57:35 +0200 Subject: [PATCH] Add Oh My Posh to windows --- scripts/Windows/Config/Oh My Posh/Install.ps1 | 7 +++++++ scripts/Windows/OS/Install.ps1 | 1 + scripts/Windows/Software/Oh My Posh/Install.ps1 | 7 +++++++ 3 files changed, 15 insertions(+) create mode 100644 scripts/Windows/Config/Oh My Posh/Install.ps1 create mode 100644 scripts/Windows/Software/Oh My Posh/Install.ps1 diff --git a/scripts/Windows/Config/Oh My Posh/Install.ps1 b/scripts/Windows/Config/Oh My Posh/Install.ps1 new file mode 100644 index 00000000..07783c64 --- /dev/null +++ b/scripts/Windows/Config/Oh My Posh/Install.ps1 @@ -0,0 +1,7 @@ +#!/bin/pwsh +param($context) +. "$PSScriptRoot/../../Scripts/Context.ps1"; + +[Context] $context = $context; +Write-Host "Configuring Oh My Posh!"; +$context.AddPowerShellProfileStatement("999_Oh My Posh", 'oh-my-posh init pwsh | Invoke-Expression;'); diff --git a/scripts/Windows/OS/Install.ps1 b/scripts/Windows/OS/Install.ps1 index b26758ac..5b78cf1c 100644 --- a/scripts/Windows/OS/Install.ps1 +++ b/scripts/Windows/OS/Install.ps1 @@ -63,6 +63,7 @@ function Invoke-WindowsInstallation([Context] $context) . "$softwarePath/Thunderbird/Install.ps1" $context; . "$softwarePath/posh-git/Install.ps1" $context; . "$softwarePath/Terminal-Icons/Install.ps1" $context; + . "$softwarePath/Oh My Posh/Install.ps1" $context; $context.Set("MachineWideSoftware", 1, "DWord"); } diff --git a/scripts/Windows/Software/Oh My Posh/Install.ps1 b/scripts/Windows/Software/Oh My Posh/Install.ps1 new file mode 100644 index 00000000..22db1d84 --- /dev/null +++ b/scripts/Windows/Software/Oh My Posh/Install.ps1 @@ -0,0 +1,7 @@ +#!/bin/pwsh +param($context); +. "$PSScriptRoot/../../Scripts/Context.ps1"; + +[Context] $context = $context; +winget install --accept-source-agreements --accept-package-agreements -s winget JanDeDobbeleer.OhMyPosh; +. "$PSScriptRoot/../../Config/Oh My Posh/Install.ps1" $context;