function Get-ComponentInstallerUninstallPath { param( [Parameter(Mandatory=$true)] [ValidateSet("Widget","Provider","WebExtension","WebApplication","Service")] [string]$ComponentType ) $logLead = (Get-LogLeadName) # Due to a quirk, Service was keyed as Alkami.Installer.Services and not caught early enough # This is considered acceptable because migrations also need a secondary path option for this routing $RoutedComponentType = $ComponentType if ($ComponentType -eq "Service") { $RoutedComponentType = "Services" } $alkamiPDPath = (Join-Path -Path $env:ProgramData -ChildPath "Alkami") $installerPath = (Join-Path -Path $alkamiPDPath -ChildPath "Installer") $targetInstallerPath = (Join-Path -Path $installerPath -ChildPath $RoutedComponentType) $finalPath = (Join-Path -Path $targetInstallerPath -ChildPath "uninstall.ps1") if (!(Test-Path $finalPath)) { Write-Warning "$logLead [$ComponentType] : Installer file does not exist. Have you tried [choco upgrade Alkami.Installer.$RoutedComponentType -y] lately?" } return $finalPath }