PowerShell Commandlets


This entry is part 5 of 9 in the series PowerShell

A cmdlet (commandlet) is a lightweight command that is used in the PowerShell environment. Cmdlets perform an action and typically return a Microsoft .NET object to the next command in the pipeline. A cmdlet is a single command that participates in the pipeline semantics of PowerShell. This includes binary (C#) cmdlets, advanced script functions, CDXML, and Workflows.

Running PowerShell Commands

The first way is to use the PowerShell console, which is a command-line interface, which looks similar to the DOS command-line interface you see when you run cmd in Windows. It’s used for interactive work. The second way is the PowerShell Integrated Scripting Environment (ISE). The ISE supplies an editing pane plus a combined output and interactive pane. The ISE is the tool of choice when developing scripts, functions, and other advanced functionality. The ISE is shown below. Click on it to expand it.

Getting Started with Cmdlet

In the introduction post there was a link to a YouTube video by Shane Young. He goes through a few cmdlets. The list below is very similar to the list that Shane goes through. It’s a good list for beginners to go through. Hand-on experience is always beneficial.

  • Start-Transcript
  • Start-Transcript -Path “C:\transcripts\transcript0.txt” -NoClobber
  • Get-Command
  • Ctrl+C (stops!)
  • Get-Command -noun a*
  • Get-Command -noun service
  • Get-Service
  • Get-Help
  • Get-Help Get-Service
  • Get-Help Get-Service -examples
  • get-help start-transcript -examples
  • Get-Alias
  • Get-Process
  • Get-Process -Name Chrome
  • Get-Process -Name Chrome | Get-Member
  • Get-Process -Name Chrome | Select-Object *
  • Get-History
  • cls
  • get-alias cls
  • clear-host
Series Navigation<< PowerShell VariablesPowerShell Batch Files >>