Install the package provider for PinnedItem

This commit is contained in:
Manuel Thalmann 2024-09-21 02:14:47 +02:00
parent 03b626dec9
commit d90fc5772e

View file

@ -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; $?; })) {