From 13d33293ebced1ce3a5265513cf63ac7933f43a3 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Fri, 9 Aug 2024 02:22:45 +0200 Subject: [PATCH] Add support for the `sudo` command --- scripts/Common/Scripts/Operations.ps1 | 1 + scripts/Windows/OS/Install.ps1 | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/scripts/Common/Scripts/Operations.ps1 b/scripts/Common/Scripts/Operations.ps1 index 5f9b6525..929a640d 100644 --- a/scripts/Common/Scripts/Operations.ps1 +++ b/scripts/Common/Scripts/Operations.ps1 @@ -10,5 +10,6 @@ function Start-Operation { $env:CONFIG_MODULE = Resolve-Path $env:CONFIG_MODULE; } + New-Alias "sudo" gsudo; & $Action; } diff --git a/scripts/Windows/OS/Install.ps1 b/scripts/Windows/OS/Install.ps1 index 4285ef7a..b153f114 100644 --- a/scripts/Windows/OS/Install.ps1 +++ b/scripts/Windows/OS/Install.ps1 @@ -47,6 +47,12 @@ $null = New-Module { continue; } + if (-not (Test-Command "gsudo")) { + Install-ChocoPackage gsudo; + refreshenv; + continue; + } + if (-not (Test-Command "git")) { Install-ChocoPackage git; refreshenv;