ps/Modules/Cole.PowerShell.Developer/Public/Restore-AllWidgets.ps1

22 lines
812 B
PowerShell
Raw Normal View History

2023-05-30 22:51:22 -07:00
function Restore-AllWidgets {
<#
.SYNOPSIS
This will reinstall all the widgets found locally in the chocolatey folder.
This does not upgrade the widgets.
#>
[CmdletBinding()]
[OutputType([void])]
param (
)
$logLead = (Get-LogLeadName)
$allPackages = (Get-AllInstalledComponentsByType -ComponentType Widget)
Write-Host "$logLead : Found the following packages to install"
$allPackages | Format-Table @{Name = "Package Name"; Width = 40; Expression={$_.PackageName}},@{Name = "Manifest Path"; Expression={$_.ManifestPath}}
$installerPath = (Get-ComponentInstallerInstallPath -ComponentType Widget)
Invoke-Parallel2 -Objects @($allPackages.ManifestPath) -Arguments @($installerPath) -Script { param($manifestPath,$installerPath) & $installerPath $manifestPath}
}