What is "powershell"

Powershell is Microsoft’s task automation platform. Powershell includes a shell interactive command line tool and scripting based on a GUI that can be used independently or in conjunction with the interpreter.

Along with interaction with the Powershell console or Powershell ISE, there are also several third-party IDE options: Powergui, Powershellplus and Primalscript ISE.

Powershell is developed upon the . NET Framework, and works with objects from it, offering many tools and methods to manage a Microsoft Windows environment.

Windows Powershell provides access to all. NET Apis available on the system, in addition to COM, WM w WMI objects and other Microsoft Apis.

Currently Microsoft’s "Server" products must provide automation support via Powershell, according to its Common Engineering Criteria.

Windows Powershell is integrated as an optional component of Windows Server 2008, enabled by default in Windows Server 2008 R2 (except core installation), Windows 7 and Windows 8, and can be downloaded for free for installation in Windows XP SP2, Windows Vista and Windows Server 2003.

Example of Use

Lists all processes using > 100 MB of paginated memory in descending order of classification

C:\PS> Get-Process | Where PagedMemorySize -GT 100MB | Sort -Descending

Powershell can also evaluate expressions

C:\PS> "Hello World!"
Hello World!

# PowerShell can handle numbers and arithmetic
C:\PS> (98.6 - 32) * 5/9
37

Allows experimentation and confirmation

C:\PS> Get-ChildItem C:\Users\John *.bak -r | 
           Where {$_.LastWriteTime -gt (Get-Date).AddDays(-7)} |
           Remove-Item -WhatIf

C:\PS> Get-Process iexp* | Stop-Process -Confirm

Resources