PowerShell

PowerShell
Screenshot of a PowerShell 7 session in Windows Terminal
ParadigmImperative, pipeline, object-oriented, functional and reflective
Designed byJeffrey Snover, Bruce Payette, James Truher (et al.)
DeveloperMicrosoft
First appearedNovember 14, 2006; 17 years ago (2006-11-14)
Stable release
7.4.6 / October 22, 2024; 19 days ago (2024-10-22)[1][2]
Typing disciplineStrong, safe, implicit and dynamic
Implementation languageC#
PlatformPowerShell: .NET
Windows PowerShell: .NET Framework
OS
LicenseMIT License[3] (but the Windows component remains proprietary)
Filename extensions
  • .ps1 (Script)
  • .ps1xml (XML Document)
  • .psc1 (Console File)
  • .psd1 (Data File)
  • .psm1 (Script Module)
  • .pssc (Session Configuration File)
  • .psrc (Role Capability File)
  • .cdxml (Cmdlet Definition XML Document)
Websitemicrosoft.com/powershell
Influenced by
Python, Ksh, Perl, C#, CL, DCL, SQL, Tcl, Tk,[4] Chef, Puppet

PowerShell is a task automation and configuration management program from Microsoft, consisting of a command-line shell and the associated scripting language. Initially a Windows component only, known as Windows PowerShell, it was made open-source and cross-platform on August 18, 2016, with the introduction of PowerShell Core.[5] The former is built on the .NET Framework, the latter on .NET (previously .NET Core).

PowerShell is bundled with all currently supported Windows versions, and can also be installed on MacOS and Linux.[5] Since Windows 10 build 14971, PowerShell replaced Command Prompt (cmd.exe) and became the default command shell for File Explorer.[6][7]

In PowerShell, administrative tasks are generally performed via cmdlets (pronounced command-lets), which are specialized .NET classes implementing a particular operation. These work by accessing data in different data stores, like the file system or Windows Registry, which are made available to PowerShell via providers. Third-party developers can add cmdlets and providers to PowerShell.[8][9] Cmdlets may be used by scripts, which may in turn be packaged into modules. Cmdlets work in tandem with the .NET API.

PowerShell's support for .NET Remoting, WS-Management, CIM, and SSH enables administrators to perform administrative tasks on both local and remote Windows systems. PowerShell also provides a hosting API with which the PowerShell runtime can be embedded inside other applications. These applications can then use PowerShell functionality to implement certain operations, including those exposed via the graphical interface. This capability has been used by Microsoft Exchange Server 2007 to expose its management functionality as PowerShell cmdlets and providers and implement the graphical management tools as PowerShell hosts which invoke the necessary cmdlets.[8][10] Other Microsoft applications including Microsoft SQL Server 2008 also expose their management interface via PowerShell cmdlets.[11]

PowerShell includes its own extensive, console-based help (similar to man pages in Unix shells) accessible via the Get-Help cmdlet. Updated local help contents can be retrieved from the Internet via the Update-Help cmdlet. Alternatively, help from the web can be acquired on a case-by-case basis via the -online switch to Get-Help.

  1. ^ "PowerShell". Microsoft Apps. Retrieved October 24, 2024.
  2. ^ "Release v7.4.6 Release of PowerShell". PowerShell/PowerShell repo. Microsoft. Retrieved October 22, 2024 – via GitHub.com.
  3. ^ "PowerShell for every system!". June 12, 2017 – via GitHub.com.
  4. ^ Snover, Jeffrey (May 25, 2008). "PowerShell and WPF: WTF". Windows PowerShell Blog. Microsoft.
  5. ^ a b Cite error: The named reference ars-opensource was invoked but never defined (see the help page).
  6. ^ "Announcing Windows 10 Insider Preview Build 14971 for PC". November 17, 2016.
  7. ^ "PowerShell is replacing Command Prompt".
  8. ^ a b Cite error: The named reference how was invoked but never defined (see the help page).
  9. ^ Truher, Jim (December 2007). "Extend Windows PowerShell With Custom Commands". MSDN Magazine. Microsoft. Archived from the original on October 6, 2008.
  10. ^ Lowe, Scott (January 4, 2007). "Exchange 2007: Get used to the command line". TechRepublic. CBS Interactive. Archived from the original on November 16, 2018. Retrieved May 12, 2020.
  11. ^ Snover, Jeffrey (November 13, 2007). "SQL Server Support for PowerShell!". Windows PowerShell Blog (blog posting). Microsoft. Archived from the original on November 15, 2007. Retrieved November 13, 2007.