From 168b321e029c71525aafd09e53f71bfb2d0377fb Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 9 Oct 2021 11:03:19 +0200 Subject: [PATCH] fix(pwsh): trust PSGallery (#33) This prevents PowerShell from prompting if we should trust PSGallery during module installation without `-Force` --- linux/ubuntu/scripts/pwsh.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linux/ubuntu/scripts/pwsh.sh b/linux/ubuntu/scripts/pwsh.sh index 15b71c9..d408108 100755 --- a/linux/ubuntu/scripts/pwsh.sh +++ b/linux/ubuntu/scripts/pwsh.sh @@ -30,6 +30,8 @@ pwsh -v printf "\n\tšŸ‹ Installing PowerShell modules šŸ‹\t\n" modules=("MarkdownPS" "Pester" "PSScriptAnalyzer") +pwsh -nol -nop -c "Set-PSRepository -Name PSGallery -InstallationPolicy Trusted" + for mod in "${modules[@]}"; do printf "\n\tšŸ‹ Installing %s šŸ‹\t\n" "${mod}" pwsh -nol -nop -c "Install-Module -Name ${mod} -Scope AllUsers -SkipPublisherCheck -Force"