Skip to content

Commit

Permalink
Updates to PowerShell help docs (#4781)
Browse files Browse the repository at this point in the history
- [x] I have signed the [Contributor License
Agreement](https://cla.opensource.microsoft.com/microsoft/winget-pkgs).
- [x]  This pull request is related to an issue
	- Closes #4773


Each change is broken into a separate commit to help with reviewing.
Changes include:
- Couple more examples for cmdlets
- Linter fixes. Majority of them involve newline after a heading &
code-fenced blocks wanting a language tag

###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/microsoft/winget-cli/pull/4781)
  • Loading branch information
mdanish-kh authored Sep 3, 2024
1 parent 524c43c commit 472adff
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
27 changes: 26 additions & 1 deletion src/PowerShell/Help/Microsoft.WinGet.Client/Get-WinGetPackage.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Get-WinGetPackage [-Tag <String>] [-Command <String>] [-Count <UInt32>] [-Id <St

This command lists all of the packages installed on your system. The output includes packages
installed from WinGet sources and packages installed by other methods. Packages that have package
identifiers starting with `MSIX` or `ARP` were not installed from a WinGet source.
identifiers starting with `MSIX` or `ARP` could not be correlated to a WinGet source.

## EXAMPLES

Expand All @@ -36,6 +36,31 @@ Get-WinGetPackage

This example shows how to list all packages installed on your system.

### Example 2: Get package by Id

```powershell
Get-WinGetPackage -Id "Microsoft.PowerShell"
```

This example shows how to get an installed package by its package identifier.

### Example 3: Get package(s) by name

```powershell
Get-WinGetPackage -Name "PowerShell"
```

This example shows how to get installed packages that match a name value. The command does a substring comparison of the provided name with
installed package names.

### Example 4: List all packages with an available update

```powershell
Get-WinGetPackage | Where-Object IsUpdateAvailable
```

This example shows how to list all packages that have an available upgrade from one of the configured sources.

## PARAMETERS

### -Command
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ This example shows how to update a specific version of a package using a query.
query search for packages matching `Microsoft.PowerShell`. The results of the search a limited to
matches with the version of `7.4.4.0`.

### Example 5: Update all packages

```powershell
Get-WinGetPackage | Where-Object IsUpdateAvailable | Update-WinGetPackage
```

This example shows how to update all packages that have an available upgrade from one of the configured sources.

## PARAMETERS

### -AllowHashMismatch
Expand Down

0 comments on commit 472adff

Please sign in to comment.