Sample_GetPackage.ps1 (697B)
1 <# 2 .SYNOPSIS 3 Example for 'Get-WinGetPackage' cmdlet. 4 Displays a list of the applications currently installed on your computer. 5 #> 6 7 # TODO: Replace parameter with actual module name from PSGallery once module is released. 8 Param ( 9 [Parameter(Mandatory)] 10 $ModulePath 11 ) 12 13 Import-Module -Name $ModulePath 14 15 # List all installed packages 16 Get-WinGetPackage 17 18 # List installed package by name 19 Get-WinGetPackage -Name git 20 21 # List 10 packages by name 22 Get-WinGetPackage -Name git -Count 10 23 24 # List package by package identifier 25 Get-WinGetPackage -Id git.git 26 27 # List exact package from a specific source. 28 Get-WinGetPackage -Id Git.Git -Source winget -Exact