From f3601f370319c4adcccd1d1ec753d35b4b4edaa4 Mon Sep 17 00:00:00 2001 From: Kitty Cat Date: Sun, 7 Jul 2024 16:36:21 -0400 Subject: [PATCH] initenv: ensure that winget module is available --- initenv.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/initenv.ps1 b/initenv.ps1 index 2d1e727..3b88f18 100644 --- a/initenv.ps1 +++ b/initenv.ps1 @@ -1,3 +1,9 @@ +# Ensure that WinGet PS Module is available +if (!(Get-Module -ListAvailable -Name Microsoft.WinGet.Client)) { + Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted + Install-Module -Name Microsoft.WinGet.Client -Repository "PSGallery" +} + # Get installed applications so that we can identify what needs to be installed $InstalledApplications = Get-WmiObject -Class Win32_Product