A Few Basic Cmdlets

Following is a list of a few basic cmdlets and how they can be used, with a brief example:

Get-ChildItem (aka dir, gci)—Cmdlet used to list child items in a provider. Mostly used to list things such as files and directories in a file system. Example: Get-ChildItem *.ps1

Select-ObjectCmdlet used to retrieve only specific properties. See Get-Help Select-Object –Examples for examples.

Group-ObjectCmdlet used to group objects based on their properties. See Get-Help Group-Object –Examples for examples.

Sort-ObjectCmdlet used to sort objects based on their properties. See Get-Help Sort-Object –Examples for examples.

Read-HostCmdlet used to read input from the screen, usually from a user, before continuing. Example: ...

Get Microsoft® SQL Server 2008 R2 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.