Install the package provider for PinnedItem

This commit is contained in:
Manuel Thalmann 2024-09-21 02:14:47 +02:00
parent 60cd9e8e53
commit daa761d084

View file

@ -20,7 +20,13 @@ Start-SoftwareInstaller @parameters -Installer {
[hashtable] $Arguments [hashtable] $Arguments
) )
$providerName = "NuGet";
$module = $Arguments.Name; $module = $Arguments.Name;
if ({ $null = powershell -c "Get-PackageProvider -ListAvailable $providerName"; $? }) {
$null = powershell -c "Install-PackageProvider -Force $providerName";
}
& $Arguments.Installer @PSBoundParameters; & $Arguments.Installer @PSBoundParameters;
if (-not (& { powershell -NoProfile -Command "Import-Module $module; exit ([bool]`$Error)" 2> $null; $?; })) { if (-not (& { powershell -NoProfile -Command "Import-Module $module; exit ([bool]`$Error)" 2> $null; $?; })) {