From 1af584b4ea6d77812bfcb2f6474fee6ee1b13666 Mon Sep 17 00:00:00 2001 From: MKletz Date: Mon, 8 Jan 2024 09:08:52 -0600 Subject: [PATCH] Workaround for #109 (#123) Co-authored-by: willtome --- windows/powershell_dsc.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/windows/powershell_dsc.yml b/windows/powershell_dsc.yml index dc91e42..0c6aae4 100644 --- a/windows/powershell_dsc.yml +++ b/windows/powershell_dsc.yml @@ -4,6 +4,18 @@ gather_facts: false tasks: + - name: Setup PsGallery + ansible.windows.win_powershell: + script: | + $nuget_version = (Get-PackageProvider -Name NuGet -ListAvailable).version + $nuget_target_version = [Version]::new('2.8.5.201') + if( $nuget_version -lt $nuget_target_version ){ + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + Install-PackageProvider -Name NuGet -MinimumVersion $nuget_target_version -Force + Install-Module -Name packagemanagement -Force + Install-Module -Name powershellget -Force + } + - name: Setup the SecurityPolicyDSC module community.windows.win_psmodule: name: SecurityPolicyDSC