brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: Get-Help -Examples skips straight to the examples of a PowerShell command

CLI
~/tips/tip-cli-get-help-examples

Get-Help Get-ChildItem -Examples

Shows only the usage examples of a cmdlet instead of the full help text.

PowerShell help is thorough and long. Most of the time I just want to see how the command is used.

Ask for the examples only:

Get-Help Get-ChildItem -Examples

You get the name, the synopsis and every example, nothing else. Two siblings narrow it differently:

Get-Help Get-ChildItem -Parameter Recurse
Get-Help Get-ChildItem -Online

-Parameter explains one parameter, and * lists them all. -Online opens the current version of the page in your browser.

While typing, PSReadLine has two shortcuts for the same help. F1 shows the full help of the command left of the cursor, jumping to the parameter you are on, and Alt+h shows a short description of that parameter below the line.

If the examples section is empty or the help looks very short, the help files are not installed. Windows doesn’t ship them for its built-in modules. Run Update-Help once to download them (in Windows PowerShell 5.1 from an elevated window), or use -Online, which always works. Help is per module, so a module you install later may need its own update.

Further reading: Get-Help (Microsoft Learn), Using dynamic help (Microsoft Learn)

More CLI tips printf 'GET /\r\n' | hexdump -C hexdump -C -s 512 -n 64 disk.img wget --limit-rate=2m https://example.com/big-file.iso wget --spider https://example.com/file.zip rg 'apiKey' -g '!*.min.js' -g '!package-lock.json' All CLI tips (46) All topics

Link