Invoke-YTdlpWinget
SYNOPSIS
Runs the Windows Package Manager (winget)
SYNTAX
Invoke-YTdlpWinget [-ArgumentList] <String[]> [-ProgressAction <ActionPreference>] [<CommonParameters>]
DESCRIPTION
The Invoke-YTdlpWinget function runs winget with the supplied arguments & returns the exit code. winget is only available on Windows so an error is thrown on any other platform or if winget is not installed.
These winget exit codes are not treated as failures by callers: -1978335189 (0x8A15002B) - No applicable update found -1978335135 (0x8A150061) - Package already installed
EXAMPLES
EXAMPLE 1
Invoke-YTdlpWinget -ArgumentList 'install', '--id', 'yt-dlp.yt-dlp', '--exact'
Installs yt-dlp using winget & returns the winget exit code
PARAMETERS
-ArgumentList
The arguments to pass to winget
Type: String[]
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ProgressAction
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
N/A
OUTPUTS
System.Int32
NOTES
Copyright 1990-2026 Celerium
NAME: Invoke-YTdlpWinget Type: Private
AUTHOR: David Schulte
DATE: 2025-11-11
EMAIL: celerium@Celerium.org
TODO:
RELATED LINKS
https://learn.microsoft.com/en-us/windows/package-manager/winget/