Add a script for installing Oh My Posh
This commit is contained in:
parent
7fed854044
commit
1be771628b
28
scripts/Common/Software/Oh My Posh/Manage.ps1
Normal file
28
scripts/Common/Software/Oh My Posh/Manage.ps1
Normal file
|
@ -0,0 +1,28 @@
|
|||
param (
|
||||
$Action,
|
||||
[hashtable] $Arguments
|
||||
)
|
||||
|
||||
. "$PSScriptRoot/../PowerShell/Profile.ps1";
|
||||
. "$PSScriptRoot/../../Scripts/Software.ps1";
|
||||
. "$PSScriptRoot/../../Types/InstallerAction.ps1";
|
||||
|
||||
Start-SoftwareInstaller @PSBoundParameters `
|
||||
-Installer {
|
||||
param(
|
||||
[scriptblock] $Installer
|
||||
)
|
||||
|
||||
& $Installer -Action ([InstallerAction]::Configure);
|
||||
} `
|
||||
-Configurator {
|
||||
Add-PowerShellProfileStatement `
|
||||
-System `
|
||||
-Category "oh-my-posh" `
|
||||
-Script (
|
||||
@(
|
||||
"# Oh My Posh!",
|
||||
(Get-ScriptInitializer "oh-my-posh init pwsh"),
|
||||
(Get-ScriptInitializer "oh-my-posh completion powershell")
|
||||
) -join [System.Environment]::NewLine)
|
||||
};
|
|
@ -188,6 +188,7 @@ $null = New-Module {
|
|||
. "$softwarePath/chocolatey/Manage.ps1" @arguments;
|
||||
. "$commonSoftware/posh-git/Manage.ps1" @arguments;
|
||||
. "$commonSoftware/Terminal-Icons/Manage.ps1" @arguments;
|
||||
. "$commonSoftware/Oh My Posh/Manage.ps1" @arguments;
|
||||
}
|
||||
|
||||
if (Test-Collection "common") {
|
||||
|
|
21
scripts/Windows/Software/Oh My Posh/Manage.ps1
Normal file
21
scripts/Windows/Software/Oh My Posh/Manage.ps1
Normal file
|
@ -0,0 +1,21 @@
|
|||
param (
|
||||
$Action,
|
||||
[hashtable] $Arguments
|
||||
)
|
||||
|
||||
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
|
||||
. "$PSScriptRoot/../../../Common/Types/InstallerAction.ps1";
|
||||
|
||||
Start-SoftwareInstaller @PSBoundParameters `
|
||||
-Installer {
|
||||
param(
|
||||
[scriptblock] $Installer
|
||||
)
|
||||
|
||||
Install-WingetPackage JanDeDobbeleer.OhMyPosh;
|
||||
& $Installer -Action ([InstallerAction]::Configure);
|
||||
} `
|
||||
-Configurator {
|
||||
. "$PSScriptRoot/../../../Common/Software/Oh My Posh/Manage.ps1" `
|
||||
-Action ([InstallerAction]::Configure);
|
||||
};
|
Loading…
Reference in a new issue