diff --git a/scripts/Windows/Software/PinnedItem/Manage.ps1 b/scripts/Windows/Software/PinnedItem/Manage.ps1 index 27187fa3..7631a130 100644 --- a/scripts/Windows/Software/PinnedItem/Manage.ps1 +++ b/scripts/Windows/Software/PinnedItem/Manage.ps1 @@ -20,7 +20,13 @@ Start-SoftwareInstaller @parameters -Installer { [hashtable] $Arguments ) + $providerName = "NuGet"; $module = $Arguments.Name; + + if ({ $null = powershell -c "Get-PackageProvider -ListAvailable $providerName"; $? }) { + $null = powershell -c "Install-PackageProvider -Force $providerName"; + } + & $Arguments.Installer @PSBoundParameters; if (-not (& { powershell -NoProfile -Command "Import-Module $module; exit ([bool]`$Error)" 2> $null; $?; })) {