web analytics

PowerShell 101 – for PenTesters

Powershell is the Windows Scripting Language and shell environment that is built using the .NET framework.

Most Powershell commands, called cmdlets, are written in .NET. 

The normal format of a cmdlet is represented using Verb-Noun. For example the cmdlet to list commands is called Get-Command and the command to get help is Get-Help.

E.g.; Get-Help Command-Name

Somewhat Object-oriented – which makes it convenient to pass output from one cmdlet to another.

Common verbs to use include:

  • Get
  • Start
  • Stop 
  • Read
  • Write
  • New
  • Out

Full list of Approved Verbs for PowerShell Commands, read here

Basic Powershell commands

Get-Help Command-Name

Using Get-Command

Get-Command Verb-* or Get-Command *-Nounor Get-Command *-Noun

Example usage: