function Test-WinUtilPackageManager { <# .DESCRIPTION Checks for Winget or Choco depending on the paramater #> Param( [System.Management.Automation.SwitchParameter]$winget, [System.Management.Automation.SwitchParameter]$choco ) if($winget){ if (Test-Path ~\AppData\Local\Microsoft\WindowsApps\winget.exe) { return $true } } if($choco){ if ((Get-Command -Name choco -ErrorAction Ignore) -and ($chocoVersion = (Get-Item "$env:ChocolateyInstall\choco.exe" -ErrorAction Ignore).VersionInfo.ProductVersion)){ return $true } } return $false }