private/Tests/Test-CommandWinget.ps1

function Test-CommandWinget {
    <#
    .SYNOPSIS
        Returns $true when winget (App Installer) is available in the current
        session PATH.
 
    .NOTES
        Author: David Segura
        Company: Recast Software
        winget is required by: Install-GitForWindows, Install-MicrosoftPwsh,
        Install-MicrosoftVSCode, Install-MicrosoftVSCodeInsiders, Install-7Zip.
 
    Dependencies:
      Module Functions: Install-7Zip, Install-GitForWindows, Install-MicrosoftPwsh, Install-MicrosoftVSCode, Install-MicrosoftVSCodeInsiders
      Executables: winget
    #>

    [OutputType([bool])]
    param ()

    return ($null -ne (Get-Command -Name 'winget' -ErrorAction SilentlyContinue))
}