Skip to content

Commit

Permalink
Attempting to fix Issue #147 as a confirmation is required when it sh…
Browse files Browse the repository at this point in the history
…ould not. (#588)

Attempting to fix Issue #147 as a confirmation is required when it should not.
  • Loading branch information
mfortin authored Nov 11, 2024
1 parent 2f3317f commit 27a1530
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions changelogs/fragments/588-nuget-requirement-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
minor_changes:
- This issue fixes installation of requirements as it requires a confirmation when installed as a depedency to PowershellGet.
Installing it by itself prevents this confirmation dialog and allows required components to be installed
(https://github.com/ansible-collections/community.windows/issues/147).
4 changes: 4 additions & 0 deletions plugins/modules/win_psmodule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ Function Install-PrereqModule {
$job = Start-Job -ScriptBlock {
$ErrorActionPreference = 'Stop'

if (-not (Get-PackageProvider -ListAvailable | Where-Object { ($_.name -eq 'Nuget') -and ($_.version -ge "2.8.5.201") }) ) {
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force | Out-Null
}

$Repository = $using:Repository

foreach ($info in $using:ToInstall) {
Expand Down

0 comments on commit 27a1530

Please sign in to comment.