PowerShell

{{Short description|Cross-platform shell based on .NET technology}}

{{Use American English|date=April 2023}}

{{Use mdy dates|date=May 2025}}

{{Infobox programming language

| name = PowerShell

| logo = PowerShell Core 6.0 icon.png

| logo size = 150px

| screenshot = PowerShell 7.5.png

| screenshot size = 250px

| screenshot caption = Screenshot of a PowerShell 7.5.0 session in Windows Terminal

| paradigm = Imperative, pipeline, object-oriented, functional and reflective

| released = {{start date and age|2006|11|14}}

| designer = Jeffrey Snover, Bruce Payette, James Truher (et al.)

| developer = Microsoft

| latest lts version = v7.4.7

| latest lts date = {{start date and age|2025|01|23}}{{Cite web

| url = https://github.com/PowerShell/PowerShell/releases/tag/v7.4.7

| title = PowerShell

| website = Microsoft Apps

| access-date = October 24, 2024}}{{Cite web |title=Release v7.4.7 Release of PowerShell |url=https://github.com/PowerShell/PowerShell/releases/tag/v7.4.7 |access-date=February 10, 2025 | website = PowerShell/PowerShell repo | publisher = Microsoft | via = GitHub.com |language=en}}

| latest release version = v7.5.0

| latest release date = {{start date and age|2025|01|23}}{{Cite web

| url = https://github.com/PowerShell/PowerShell/releases/tag/v7.5.0

| title = PowerShell

| website = Microsoft Apps

| access-date = October 24, 2024}}{{Cite web |title=Release v7.5.0 Release of PowerShell |url=https://github.com/PowerShell/PowerShell/releases/tag/v7.5.0 |access-date=February 10, 2025 | website = PowerShell/PowerShell repo | publisher = Microsoft | via = GitHub.com |language=en}}

| latest preview version = v7.6.0.preview.2

| latest preview date = {{start date and age|2025|01|23}}{{Cite web

| url = https://github.com/PowerShell/PowerShell/releases/tag/v7.6.0.preview.2

| title = PowerShell

| website = Microsoft Apps

| access-date = October 24, 2024}}{{Cite web |title=Release v7.6.0.preview.2 Release of PowerShell |url=https://github.com/PowerShell/PowerShell/releases/tag/v7.6.0-preview.2 |access-date=February 10, 2025 | website = PowerShell/PowerShell repo | publisher = Microsoft | via = GitHub.com |language=en}}

| typing = Strong, safe, implicit and dynamic

| dialects =

| influenced =

| programming language = C#

| operating system = {{Plainlist|

}}

| platform = PowerShell: .NET
Windows PowerShell: .NET Framework

| license = MIT License{{cite web|url=https://github.com/PowerShell/PowerShell|title=PowerShell for every system!|date=June 12, 2017|via=GitHub.com}} (but the Windows component remains proprietary)

| influenced_by = Python, Ksh, Perl, C#, CL, DCL, SQL, Tcl, Tk,{{cite web

| last = Snover

| first = Jeffrey

| title = PowerShell and WPF: WTF

| date = May 25, 2008

| url = https://blogs.msdn.microsoft.com/powershell/2008/05/25/powershell-and-wpf-wtf/

| website = Windows PowerShell Blog

| publisher = Microsoft

}} Chef, Puppet

| file extensions = {{Plainlist|

  • .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)

}}

}}

PowerShell is a shell program developed by Microsoft for task automation and configuration management. As is typical for a shell, it provides a command-line interpreter for interactive use and a script interpreter for automation via a language defined for it. Originally only for Windows, known as Windows PowerShell, it was made open-source and cross-platform on August 18, 2016, with the introduction of PowerShell Core. The former is built on the .NET Framework; the latter on .NET (previously .NET Core).

PowerShell is bundled with current versions of Windows and can be installed on macOS and Linux. Since Windows 10 build 14971, PowerShell replaced Command Prompt as the default command shell exposed by File Explorer.{{cite web|url=https://blogs.windows.com/windows-insider/2016/11/17/announcing-windows-10-insider-preview-build-14971-for-pc/|title=Announcing Windows 10 Insider Preview Build 14971 for PC|date=November 17, 2016 }}{{cite web|url=https://support.microsoft.com/en-us/windows/powershell-is-replacing-command-prompt-fdb690cf-876c-d866-2124-21b6fb29a45f|title=PowerShell is replacing Command Prompt}}

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.{{cite magazine | last=Truher |first=Jim | date=December 2007 | url = https://msdn.microsoft.com/en-us/magazine/cc163293.aspx | title = Extend Windows PowerShell With Custom Commands| magazine = MSDN Magazine | publisher=Microsoft | archive-url=https://web.archive.org/web/20081006195551/http://msdn.microsoft.com/en-us/magazine/cc163293.aspx |archive-date=October 6, 2008}} 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.{{cite web|title=Exchange 2007: Get used to the command line|url=http://www.techrepublic.com/article/exchange-2007-get-used-to-the-command-line/|last=Lowe|first=Scott|date=January 4, 2007|work=TechRepublic|publisher=CBS Interactive|url-status=live|archive-url=https://web.archive.org/web/20181116084157/https://www.techrepublic.com/article/exchange-2007-get-used-to-the-command-line/|archive-date=November 16, 2018|access-date=May 12, 2020}} Other Microsoft applications including Microsoft SQL Server 2008 also expose their management interface via PowerShell cmdlets.{{cite web|title=SQL Server Support for PowerShell!|url=http://blogs.msdn.com/powershell/archive/2007/11/13/sql-server-support-for-powershell.aspx|author=Snover|first=Jeffrey|date=November 13, 2007|website=Windows PowerShell Blog|publisher=Microsoft|type=blog posting|archive-url=https://web.archive.org/web/20071115215316/http://blogs.msdn.com/powershell/archive/2007/11/13/sql-server-support-for-powershell.aspx|archive-date=November 15, 2007|access-date=November 13, 2007}}

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.

{{TOC limit|4}}

Background

Shell programs, including PowerShell, trace lineage to shells in older operating systems such as MS-DOS and Xenix which exposed system functionality to the user almost exclusively via a command-line interface (CLI) {{endash}} although {{nowrap|MS-DOS 5}} also came with a complementary graphical DOS Shell. The Windows 9x family came bundled with COMMAND.COM, the command-line environment of MS-DOS. The Windows NT and Windows CE families, however, came with the newer cmd.exe {{endash}} a significant upgrade from COMMAND.COM. Both environments provide CLI for both internal and external commands and automation via batch files {{endash}} a relatively primitive language for scripting.

To address limitations of these shells {{endash}} including the inability to directly use a software component exposed via COM {{endash}} Microsoft introduced the Windows Script Host in 1998 with Windows 98, and its command-line based host, cscript.exe. It integrates with the Active Script engine and allows scripts to be written in compatible languages, such as JScript and VBScript. These scripts can use COM components directly, but it has relatively inaccessible documentation and gained a reputation as a system vulnerability vector after several high-profile computer viruses exploited weaknesses in its security provisions.

Different versions of Windows provided various special-purpose command-line interpreters (such as netsh and WMIC) with their own command sets but they were not interoperable. Windows Server 2003 further attempted to improve the command-line experience but scripting support was still unsatisfactory.{{cite web |last=Dragan |first=Richard V. |date=April 23, 2003 |title=Windows Server 2003 Delivers Improvements All Around |url=https://www.pcmag.com/archive/windows-server-2003-delivers-improvements-all-around-40764 |magazine=PCMag.com |publisher=Ziff Davis |quote=A standout feature here is that virtually all admin utilities now work from the command line (and most are available through telnet).}}

= Kermit =

Image:Professional Developers Conference 2009 Technical Leaders Panel 1 (Jeffrey Snover).jpg]]

By the late 1990s, Intel had come to Microsoft asking for help in making Windows, which ran on Intel CPUs, a more appropriate platform to support the development of future Intel CPUs. At the time, Intel CPU development was accomplished on Sun Microsystems computers which ran Solaris (a Unix variant) on RISC-architecture CPUs. The ability to run Intel's many KornShell automation scripts on Windows was identified as a key capability. Internally, Microsoft began an effort to create a Windows port of Korn Shell, which was code-named Kermit.{{cite book |last1=Jones |first1=Don |title=Shell of an Idea: The Untold History of PowerShell |date=2020 |isbn=978-1-9536450-3-6 |page=25|publisher=Don Gannon-Jones }} Intel ultimately pivoted to a Linux-based development platform that could run on Intel CPUs, rendering the Kermit project redundant. However, with a fully funded team, Microsoft program manager Jeffrey Snover realized there was an opportunity to create a more general-purpose solution to Microsoft's problem of administrative automation.

= Monad =

By 2002, Microsoft had started to develop a new approach to command-line management, including a CLI called Monad (also known as {{nowrap|Microsoft Shell}} or MSH). The ideas behind it were published in August 2002 in a white paper called the "Monad Manifesto" by its chief architect, Jeffrey Snover.{{cite news |author1=Jeffrey P. Snover |title=Monad Manifesto |url=https://www.jsnover.com/Docs/MonadManifesto.pdf |access-date=April 2, 2021 |work=Windows PowerShell Blog |publisher=Microsoft |date=August 8, 2002}} In a 2017 interview, Snover explains the genesis of PowerShell, saying that he had been trying to make Unix tools available on Windows, which didn't work due to "core architectural difference[s] between Windows and Linux". Specifically, he noted that Linux considers everything a text file, whereas Windows considers everything an "API that returns structured data". They were fundamentally incompatible, which led him to take a different approach.{{cite podcast|url=https://www.heavybit.com/library/podcasts/to-be-continuous/ep-37-the-man-behind-windows-powershell/|title=The Man Behind Windows PowerShell|publisher=Heavybit|website=To Be Continuous|host=Biggar and Harbaugh|date=September 14, 2017|access-date=September 14, 2017}}

Monad was to be a new extensible CLI with a fresh design capable of automating a range of core administrative tasks. Microsoft first demonstrated Monad publicly at the Professional Development Conference in Los Angeles in October 2003. A few months later, they opened up private beta, which eventually led to a public beta. Microsoft published the first Monad public beta release on June 17, 2005, and the Beta 2 on September 11, 2005, and Beta 3 on January 10, 2006.

= PowerShell =

File:Windows PowerShell 1.0 PD.png

On April 25, 2006, not long after the initial Monad announcement, Microsoft announced that Monad had been renamed Windows PowerShell, positioning it as a significant part of its management technology offerings.{{cite web

|url=https://blogs.msdn.microsoft.com/powershell/2006/04/25/windows-powershell-monad-has-arrived/

|title=Windows PowerShell (Monad) Has Arrived

|date=April 25, 2006

|website=Windows PowerShell Blog

|publisher=Microsoft

}} Release Candidate (RC) 1 of PowerShell was released at the same time. A significant aspect of both the name change and the RC was that this was now a component of Windows, rather than a mere add-on.

Release Candidate 2 of PowerShell version 1 was released on September 26, 2006, with final release to the web on November 14, 2006. PowerShell for earlier versions of Windows was released on January 30, 2007.{{cite web

|url=http://blogs.msdn.com/powershell/archive/2006/11/15/windows-powershell-windows-vista.aspx

|type=blog posting

|title=Windows PowerShell & Windows Vista

|date=November 15, 2006

|last=Snover

|first=Jeffrey

|website=Windows PowerShell Blog

|publisher=Microsoft

}} PowerShell v2.0 development began before PowerShell v1.0 shipped. During the development, Microsoft shipped three community technology previews (CTP). Microsoft made these releases available to the public. The last CTP release of Windows PowerShell v2.0 was made available in December 2008.

PowerShell v2.0 was completed and released to manufacturing in August 2009, as an integral part of Windows 7 and Windows Server 2008 R2. Versions of PowerShell for Windows XP, Windows Server 2003, Windows Vista and Windows Server 2008 were released in October 2009 and are available for download for both 32-bit and 64-bit platforms.{{cite web

|url=http://support.microsoft.com/kb/968929

|title=Windows Management Framework (Windows PowerShell 2.0, WinRM 2.0, and BITS 4.0)

|website=Support

|publisher=Microsoft

|date=September 30, 2013

|url-status=dead

|archive-date=October 13, 2013

|archive-url=https://web.archive.org/web/20131013100052/http://support.microsoft.com/kb/968929

}} In an October 2009 issue of TechNet Magazine, Microsoft called proficiency with PowerShell "the single most important skill a Windows administrator will need in the coming years".{{cite news |last1=Posey |first1=Brien |title=10 reasons why you should learn to use PowerShell |url=https://www.techrepublic.com/blog/10-things/10-reasons-why-you-should-learn-to-use-powershell/ |access-date=April 2, 2021 |work=TechRepublic |date=October 6, 2009}}

Windows 10 shipped with Pester, a script validation suite for PowerShell.{{cite web|url=https://blogs.technet.microsoft.com/heyscriptingguy/2015/12/14/what-is-pester-and-why-should-i-care/|title=What is Pester and Why Should I Care?|date=December 14, 2015}}

File:Powershell for Linux on Ubuntu 22.10.png 22.10]]

On August 18, 2016, Microsoft announced{{Cite web|url=https://azure.microsoft.com/en-us/blog/powershell-is-open-sourced-and-is-available-on-linux/ |title=PowerShell is open sourced and is available on Linux |website=Microsoft Azure Blog |publisher=Microsoft|date=August 18, 2016 |first=Jeffrey |last=Snover}} that they had made PowerShell open-source and cross-platform with support for Windows, macOS, CentOS and Ubuntu.{{cite web|title=PowerShell is Microsoft's latest open source release, coming to Linux, OS X|url=https://arstechnica.com/information-technology/2016/08/powershell-is-microsofts-latest-open-source-release-coming-to-linux-os-x/|last1=Bright|first1=Peter|date=August 18, 2016|website=Ars Technica|publisher=Condé Nast|url-status=live|archive-url=https://web.archive.org/web/20200409020253/https://arstechnica.com/information-technology/2016/08/powershell-is-microsofts-latest-open-source-release-coming-to-linux-os-x/|archive-date=April 9, 2020|access-date=May 12, 2020}} The source code was published on GitHub.{{Cite web|url=https://github.com/PowerShell/PowerShell|title=PowerShell/PowerShell|website=GitHub|access-date=August 18, 2016}} The move to open source created a second incarnation of PowerShell called "PowerShell Core", which runs on .NET Core. It is distinct from "Windows PowerShell", which runs on the full .NET Framework.{{cite web|last1=Hansen|first1=Kenneth|last2=Calvo|first2=Angel|title=PowerShell on Linux and Open Source!|url=https://blogs.msdn.microsoft.com/powershell/2016/08/18/powershell-on-linux-and-open-source-2/|website=Windows PowerShell Blog|publisher=Microsoft|date=August 18, 2016}} Starting with version 5.1, PowerShell Core is bundled with Windows Server 2016 Nano Server.{{cite web |url=https://www.zdnet.com/article/microsoft-open-sources-powershell-brings-it-to-linux-and-mac-os-x/ |title=Microsoft open sources PowerShell; brings it to Linux and Mac OS X |work=ZDNet |publisher=CBS Interactive |first=Mary Jo |last=Foley |author-link=Mary Jo Foley |date=August 18, 2016}}{{Cite web|url=https://technet.microsoft.com/en-us/windows-server-docs/get-started/powershell-on-nano-server|title=PowerShell on Nano Server|date=October 20, 2016|website=TechNet|publisher=Microsoft}}

= Pash =

A project named Pash, a pun on the widely known "bash" Unix shell, has been an open-source and cross-platform reimplementation of PowerShell via the Mono framework.{{cite web|url=http://pash.sourceforge.net/ |title=Pash |work=SourceForge |publisher=Dice Holdings, Inc. |access-date=September 27, 2011}} Pash was created by Igor Moochnick, written in C# and was released under the GNU General Public License. Pash development stalled in 2008, was restarted on GitHub in 2012,{{cite web|url=https://github.com/Pash-Project/Pash/ |title=Pash Project|website=GitHub|access-date=April 10, 2013}} and finally ceased in 2016 when PowerShell was officially made open-source and cross-platform.{{Cite web|url=https://github.com/Pash-Project/Pash/issues/429|title=Pash is now obsolete · Issue #429 · Pash-Project/Pash|website=GitHub|language=en|access-date=November 26, 2019}}

Design

=Philosophy=

A key design goal for PowerShell was to leverage the large number of APIs that already existed in Windows, Windows Management Instrumentation, .NET Framework, and other software. PowerShell cmdlets generally wrap and expose existing functionality instead of implementing new functionality. The intent was to provide an administrator-friendly, more-consistent interface between administrators and a wide range of underlying functionality. With PowerShell, an administrator doesn't need to know .NET, WMI, or low-level API coding, and can instead focus on using the cmdlets exposed by PowerShell. In this regard, PowerShell creates little new functionality, instead focusing on making existing functionality more accessible to a particular audience.{{cite book |last1=Jones |first1=Don |title=Shell of an Idea: The Untold History of PowerShell |date=2020 |isbn=978-1-9536450-3-6 |page=45|publisher=Don Gannon-Jones }}

= Grammar =

PowerShell's developers based the core grammar of the tool on that of the POSIX 1003.2 KornShell.

{{cite book

| last1 = Payette

| first1 = Bruce

| title = Windows PowerShell in Action

| url = https://books.google.com/books?id=MYZQAAAAMAAJ

| series = Manning Pubs Co Series

| publisher = Manning

| date = 2008

| page = 27

| isbn = 9781932394900

| access-date = July 22, 2016

| quote = The core PowerShell language is based on the POSIX 1003.2 grammar for the Korn shell.

}}

However, PowerShell's language was also influenced by PHP, Perl, and many other existing languages.{{cite book |last1=Jones |first1=Don |title=Shell of an Idea: The Untold History of PowerShell |date=2020 |isbn=978-1-9536450-3-6 |page=109|publisher=Don Gannon-Jones }}

= Named Commands =

PowerShell can execute four kinds of named commands:{{cite web |title=about_Command_Precedence |url=https://technet.microsoft.com/en-us/library/hh848304.aspx |website=TechNet |publisher=Microsoft |date=May 8, 2014}}

  • cmdlets (.NET Framework programs designed to interact with PowerShell)
  • PowerShell scripts (files suffixed by .ps1)
  • PowerShell functions
  • Standalone executable programs

If a command is a standalone executable program, PowerShell launches it in a separate process; if it is a cmdlet, it executes in the PowerShell process. PowerShell provides an interactive command-line interface, where the commands can be entered and their output displayed. The user interface offers customizable tab completion. PowerShell enables the creation of aliases for cmdlets, which PowerShell textually translates into invocations of the original commands. PowerShell supports both named and positional parameters for commands. In executing a cmdlet, the job of binding the argument value to the parameter is done by PowerShell itself, but for external executables, arguments are parsed by the external executable independently of PowerShell interpretation.{{Cite web|last=Wheeler|first=Sean|date=September 7, 2021|title=about Parsing - PowerShell|url=https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_parsing?view=powershell-7.2#passing-arguments-to-native-commands|access-date=December 5, 2021|website=Microsoft Docs}}

= Extended Type System =

The PowerShell Extended Type System (ETS) is based on the .NET type system, but with extended semantics (for example, propertySets and third-party extensibility). For example, it enables the creation of different views of objects by exposing only a subset of the data fields, properties, and methods, as well as specifying custom formatting and sorting behavior. These views are mapped to the original object using XML-based configuration files.{{cite web | url = http://msdn2.microsoft.com/en-us/library/ms714419.aspx | title = Windows PowerShell Extended Type System | access-date = November 28, 2007}}

= Cmdlets =

A cmdlet is a .NET class that derives either from Cmdlet or from PSCmdlet; the latter used when it needs to interact with the PowerShell runtime. The base classes specify methods {{endash}} BeginProcessing(), ProcessRecord() and EndProcessing() {{endash}} which a cmdlet overrides to provide functionality based on the events that these functions represent. ProcessRecord() is called if the object receives pipeline input.{{cite web | url = http://msdn2.microsoft.com/en-us/library/ms714622.aspx | title = Creating Your First Cmdlet | access-date = November 28, 2007}} If a collection of objects is piped, the method is invoked for each object in the collection. The cmdlet class must have the attribute CmdletAttribute which specifies the verb and the noun that make up the name of the cmdlet.

A cmdlet name follows a Verb-Noun naming pattern, such as Get-ChildItem, which tends to make it self-documented.{{cite web | url = http://msdn2.microsoft.com/en-us/library/ms714395.aspx | title = Windows PowerShell Cmdlets | access-date = November 28, 2007}} Common verbs are provided as an enum.{{cite web |title= Get-Verb |url= https://technet.microsoft.com/en-us/library/hh852690.aspx |website= TechNet |publisher= Microsoft |date= May 8, 2014}}{{cite web |title= Cmdlet Overview |url= https://msdn.microsoft.com/en-us/library/ms714395%28v=vs.85%29.aspx |website= MSDN |publisher= Microsoft |date= May 8, 2014}}

If a cmdlet receives either pipeline input or command-line parameter input, there must be a corresponding property in the class, with a mutator implementation. PowerShell invokes the mutator with the parameter value or pipeline input, which is saved by the mutator implementation in class variables. These values are then referred to by the methods which implement the functionality. Properties that map to command-line parameters are marked by ParameterAttribute{{cite web | url = http://msdn2.microsoft.com/en-us/library/ms714663.aspx | title = Adding parameters That Process Command Line Input | access-date = November 28, 2007}} and are set before the call to BeginProcessing(). Those which map to pipeline input are also flanked by ParameterAttribute, but with the ValueFromPipeline attribute parameter set.{{cite web | url = http://msdn2.microsoft.com/en-us/library/ms714597.aspx | title = Adding parameters That Process Pipeline Input | access-date = November 28, 2007}}

A cmdlet can use any .NET API and may be written in any .NET language. In addition, PowerShell makes certain APIs available, such as WriteObject(), which is used to access PowerShell-specific functionality, such as writing objects to the pipeline. A cmdlet can use .NET a data access API directly or use the PowerShell infrastructure of Providers, which make data stores addressable using unique paths. Data stores are exposed using drive letters, and hierarchies within them, addressed as directories. PowerShell ships with providers for the file system, registry, the certificate store, as well as the namespaces for command aliases, variables, and functions.{{cite web | url = https://technet.microsoft.com/en-us/library/dd347723.aspx | title = Windows PowerShell Providers | access-date = October 14, 2010}} PowerShell also includes various cmdlets for managing various Windows systems, including the file system, or using Windows Management Instrumentation to control Windows components. Other applications can register cmdlets with PowerShell, thus allowing it to manage them, and, if they enclose any datastore (such as a database), they can add specific providers as well.{{citation needed|date=May 2013}}

A cmdlet can be added to the shell via modules or before v2 snap-ins. Users are not limited to the cmdlets included in the base PowerShell installation.

The number of cmdlets included in the base PowerShell install for various versions:

  • Windows PowerShell 1.0: 129{{Cite web|url=https://social.technet.microsoft.com/wiki/contents/articles/13769.powershell-1-0-cmdlets.aspx|title=PowerShell 1.0 Cmdlets|last1=Yoshizawa|first1=Tomoaki|last2=Ramos|first2=Durval|date=September 29, 2012|website=TechNet Articles|publisher=Microsoft}}
  • Windows PowerShell 2.0: 632{{Cite web|url=https://social.technet.microsoft.com/wiki/contents/articles/13876.powershell-2-0-cmdlets.aspx|title=PowerShell 2.0 Cmdlets|last=Yoshizawa|first=Tomoaki|date=July 10, 2012|website=TechNet Articles|publisher=Microsoft}}
  • Windows PowerShell 3.0: ≈1,000{{Cite book|last=Wilson|first=Ed|title=Windows Powershell 3.0 Step by Step|date=2013|publisher=Microsoft Press|isbn=978-0-7356-7000-6|location=Sebastopol, California|chapter=1: Overview of Windows PowerShell 3.0|oclc=829236530|quote=Windows PowerShell 3.0 comes with about 1,000 cmdlets on Windows 8|chapter-url=https://www.microsoftpressstore.com/articles/article.aspx?p=2201304}}

  • Windows PowerShell 5.0: ≈1,300{{Cite book|last=Wilson|first=Ed|title=Windows PowerShell Step by Step|publisher=Microsoft Press|isbn=978-1-5093-0043-3|edition=Third|location=Redmond, Washington|chapter=1: Overview of Windows PowerShell 5.0|year=2015|oclc=927112976|quote=Windows PowerShell 5.0 comes with about 1,300 cmdlets on Windows 10|chapter-url=https://www.microsoftpressstore.com/articles/article.aspx?p=2449029}}
  • Windows PowerShell 5.1: 1,586{{Citation needed|date=April 2020}}

  • PowerShell 7.0: 1,507{{Citation needed|date=April 2020}}

  • PowerShell 7.4: 1,656

= Pipeline =

To enable pipeline semantics, similar to the Unix pipeline, a cmdlet receives input and outputs result as objects. If a cmdlet outputs multiple objects, each object of the collection is passed through the pipeline before the next object is processed. A PowerShell pipeline enables complex logic using the pipe (|) operator to connect stages. However, the PowerShell pipeline differs from Unix pipelines in that stages execute within the PowerShell runtime rather than as a set of processes coordinated by the operating system. Additionally, structured .NET objects, rather than byte streams, are passed from one stage to the next. Using objects and executing stages within the PowerShell runtime eliminates the need to serialize data structures, or to extract them by explicitly parsing text output.{{cite web |url= https://technet.microsoft.com/en-us/library/ee176927.aspx |title= Windows PowerShell Owner's Manual: Piping and the Pipeline in Windows PowerShell |work= TechNet |publisher= Microsoft |access-date= September 27, 2011}} An object can also encapsulate certain functions that work on the contained data, which become available to the recipient command for use.{{cite web | url = http://www.microsoft.com/technet/technetmag/issues/2007/07/PowerShell/default.aspx | title = Windows PowerShell – Rethinking the Pipeline |first= Don |last= Jones|year= 2008|work= Microsoft TechNet |publisher= Microsoft | access-date = November 28, 2007}}{{cite web|url= http://msdn2.microsoft.com/en-us/library/aa347685.aspx |title= Windows PowerShell Object Concepts |access-date= November 28, 2007 |url-status= dead |archive-url= https://web.archive.org/web/20070819233213/http://msdn2.microsoft.com/en-us/library/aa347685.aspx |archive-date= August 19, 2007 }} For the last cmdlet in a pipeline, PowerShell automatically pipes its output object to the Out-Default cmdlet, which transforms the objects into a stream of format objects and then renders those to the screen.{{cite web | url = http://blogs.msdn.com/powershell/archive/2006/04/30/586973.aspx | title = How PowerShell Formatting and Outputting REALLY works| access-date = November 28, 2007}}{{cite web | url = http://blogs.msdn.com/powershell/archive/2006/06/21/641738.aspx | title = More – How does PowerShell formatting really work? | access-date = November 28, 2007}}

Because a PowerShell object is a .NET object, it has a .ToString() method which is used to serialize object state. In addition, PowerShell allows formatting definitions to be specified, so the text representation of objects can be customized by choosing which data elements to display, and in what manner. However, in order to maintain backward compatibility, if an external executable is used in a pipeline, it receives a text stream representing the object, instead of directly integrating with the PowerShell type system.{{cite web|title= about_Pipelines|url= https://technet.microsoft.com/en-us/library/hh847902.aspx|website= TechNet | publisher= Microsoft|date= May 8, 2014}}{{cite web|title= about_Objects|url= https://technet.microsoft.com/en-us/library/hh847810.aspx|website= TechNet |publisher= Microsoft|date= May 8, 2014}}{{cite web|title= about_Format.ps1xml|url= https://technet.microsoft.com/en-us/library/hh847831.aspx|website= TechNet|publisher= Microsoft|date= May 8, 2014}}

= Scripting =

PowerShell includes a dynamically typed language for scripting which can implement complex operations using cmdlets imperatively. The language supports variables, functions, branching (if-then-else), loops (while, do, for, and foreach), structured error/exception handling and closures/lambda expressions,{{cite web | url = http://defndo.com/powershell-code-blocks-and-anonymous-functions/ | title = Anonymous Functions and Code Blocks in PowerShell | access-date = January 21, 2012}} as well as integration with .NET. Variables in PowerShell scripts are prefixed with $. Variables can be assigned any value, including the output of cmdlets. Strings can be enclosed either in single quotes or in double quotes: when using double quotes, variables will be expanded even if they are inside the quotation marks. Enclosing the path to a file in braces preceded by a dollar sign (as in ${C:\foo.txt}) creates a reference to the contents of the file. If it is used as an L-value, anything assigned to it will be written to the file. When used as an R-value, the contents of the file will be read. If an object is assigned, it is serialized before being stored.{{citation needed|date=May 2013}}

Object members can be accessed using . notation, as in C# syntax. PowerShell provides special variables, such as $args, which is an array of all the command-line arguments passed to a function from the command line, and $_, which refers to the current object in the pipeline.{{cite web | url = http://www.computerperformance.co.uk/powershell/powershell_variables.htm | title = Introduction to Windows PowerShell's Variables | access-date = November 28, 2007}} PowerShell also provides arrays and associative arrays. The PowerShell language also evaluates arithmetic expressions entered on the command line immediately, and it parses common abbreviations, such as GB, MB, and KB.{{cite web|title= Byte Conversion|url= https://technet.microsoft.com/en-us/library/ee692684.aspx|work= Windows PowerShell Tip of the Week|date= October 22, 2009|access-date= November 15, 2013}}{{cite web|title= Converting to size units (KB, MB, GB, TB, and PB) without using PowerShell multipliers|url= http://www.powershellmagazine.com/2013/05/20/converting-to-size-units-kb-mbgbtb-and-pb-without-using-powershell-multipliers/|work= PowerShell Magazine|author= Ravikanth|date= May 20, 2013}}

Using the function keyword, PowerShell provides for the creation of functions. A simple function has the following general look:

function name ([Type]$Param1, [Type]$Param2) {

# Instructions

}

However, PowerShell allows for advanced functions that support named parameters, positional parameters, switch parameters and dynamic parameters.

function Verb-Noun {

param (

# Definition of static parameters

)

dynamicparam {

# Definition of dynamic parameters

}

begin {

# Set of instruction to run at the start of the pipeline

}

process {

# Main instruction sets, ran for each item in the pipeline

}

end {

# Set of instruction to run at the end of the pipeline

}

}

The defined function is invoked in either of the following forms:{{cite web|title= about_Functions|url= https://technet.microsoft.com/en-us/library/hh847829.aspx|work= Microsoft TechNet|publisher= Microsoft|access-date= November 15, 2013|date= October 17, 2013}}

name value1 value2

Verb-Noun -Param1 value1 -Param2 value2

PowerShell allows any static .NET methods to be called by providing their namespaces enclosed in brackets ([]), and then using a pair of colons (::) to indicate the static method.{{cite web | url = http://msdn.microsoft.com/msdnmag/issues/07/05/TestRun/default.aspx | title = Lightweight Testing with Windows PowerShell | access-date = November 28, 2007}} For example:

[Console]::WriteLine("PowerShell")

There are dozens of ways to create objects in PowerShell. Once created, one can access the properties and instance methods of an object using the . notation.

PowerShell accepts strings, both raw and escaped. A string enclosed between single quotation marks is a raw string while a string enclosed between double quotation marks is an escaped string. PowerShell treats straight and curly quotes as equivalent.{{cite web|last1= Angelopoulos|first1= Alex|last2= Karen|first2= Bemowski|title= PowerShell Got Smart About Smart Quotes|url= http://windowsitpro.com/powershell/powershell-got-smart-about-smart-quotes|work= Windows IT Pro|publisher= Penton Media|access-date= November 15, 2013|date= December 4, 2007}}

The following list of special characters is supported by PowerShell:{{cite web |title=About Special Characters |url=https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_special_characters?view=powershell-6 |date=June 8, 2017 |website=Microsoft |department=Powershell / Scripting |access-date=June 20, 2019}}

class="wikitable plainrowheaders" style="text-align: center; font-size: small;"

|+PowerShell special characters

scope="col" | Sequence

! scope="col" | Meaning

{{mono|`0}}

|Null

{{mono|`a}}

|Alert

{{mono|`b}}

|Backspace

{{mono|`e}}

|Escape (since PowerShell 6)

{{mono|`f}}

|Form feed

{{mono|`n}}

|Newline

{{mono|`r}}

|Carriage return

{{mono|`t}}

|Horizontal tab

{{mono|`u{x}}}

|Unicode escape sequence (since PowerShell 6)

{{mono|`v}}

|Vertical tab

{{mono
-%}}

|Treat any character from this point forward literally

For error handling, PowerShell provides a .NET-based exception-handling mechanism. In case of errors, objects containing information about the error (Exception object) are thrown, which are caught using the try ... catch construct (although a trap construct is supported as well). PowerShell can be configured to silently resume execution, without actually throwing the exception; this can be done either on a single command, a single session or perpetually.{{cite web | url = http://huddledmasses.org/trap-exception-in-powershell | title = Trap [Exception] { "In PowerShell" } | access-date = November 28, 2007}}

Scripts written using PowerShell can be made to persist across sessions in either a .ps1 file or a .psm1 file (the latter is used to implement a module). Later, either the entire script or individual functions in the script can be used. Scripts and functions operate analogously with cmdlets, in that they can be used as commands in pipelines, and parameters can be bound to them. Pipeline objects can be passed between functions, scripts, and cmdlets seamlessly. To prevent unintentional running of scripts, script execution is disabled by default and must be enabled explicitly.{{cite web | url = http://www.microsoft.com/technet/scriptcenter/topics/winpsh/manual/run.mspx | title = Running Windows PowerShell Scripts | website = Microsoft | access-date = November 28, 2007}} Enabling of scripts can be performed either at system, user or session level. PowerShell scripts can be signed to verify their integrity, and are subject to Code Access Security.{{cite web|title= about_Signing|url= https://technet.microsoft.com/en-us/library/hh847874.aspx|work= Microsoft TechNet|publisher= Microsoft|access-date= November 15, 2013|date= October 17, 2013}}

The PowerShell language supports binary prefix notation similar to the scientific notation supported by many programming languages in the C-family.{{Cite book|title=Windows PowerShell Quick Reference|author=Lee Holmes|publisher= O'Reilly Media|date=September 2006}}

= Hosting =

One can also use PowerShell embedded in a management application, which uses the PowerShell runtime to implement the management functionality. For this, PowerShell provides a managed hosting API. Via the APIs, the application can instantiate a runspace (one instantiation of the PowerShell runtime), which runs in the application's process and is exposed as a Runspace object. The state of the runspace is encased in a SessionState object. When the runspace is created, the PowerShell runtime initializes the instantiation, including initializing the providers and enumerating the cmdlets, and updates the SessionState object accordingly. The Runspace then must be opened for either synchronous processing or asynchronous processing. After that it can be used to execute commands.{{citation needed|date=May 2013}}

To execute a command, a pipeline (represented by a Pipeline object) must be created and associated with the runspace. The pipeline object is then populated with the cmdlets that make up the pipeline. For sequential operations (as in a PowerShell script), a Pipeline object is created for each statement and nested inside another Pipeline object. When a pipeline is created, PowerShell invokes the pipeline processor, which resolves the cmdlets into their respective assemblies (the command processor) and adds a reference to them to the pipeline, and associates them with InputPipe, OutputPipe and ErrorOutputPipe objects, to represent the connection with the pipeline. The types are verified and parameters bound using reflection. Once the pipeline is set up, the host calls the Invoke() method to run the commands, or its asynchronous equivalent, InvokeAsync(). If the pipeline has the Write-Host cmdlet at the end of the pipeline, it writes the result onto the console screen. If not, the results are handed over to the host, which might either apply further processing or display the output itself.{{citation needed|date=May 2013}}

Microsoft Exchange Server 2007 uses the hosting APIs to provide its management GUI. Each operation exposed in the GUI is mapped to a sequence of PowerShell commands (or pipelines). The host creates the pipeline and executes them. In fact, the interactive PowerShell console itself is a PowerShell host, which interprets the scripts entered at command line and creates the necessary Pipeline objects and invokes them.{{citation needed|date=May 2013}}

= Desired State Configuration =

DSC allows for declaratively specifying how a software environment should be configured.{{cite web|url=https://msdn.microsoft.com/en-us/powershell/dsc/overview|title=Windows PowerShell Desired State Configuration Overview|last=eslesar|website=msdn.microsoft.com|date=May 23, 2023 }}

Upon running a configuration, DSC will ensure that the system gets the state described in the configuration. DSC configurations are idempotent. The Local Configuration Manager (LCM) periodically polls the system using the control flow described by resources (imperative pieces of DSC) to make sure that the state of a configuration is maintained.

Versions

All major releases are still supported, and each major release has featured backwards compatibility with preceding versions.{{dubious|date=May 2025}}

= Project Monad =

Initially using the code name "Monad", PowerShell was first shown publicly at the Professional Developers Conference in October 2003 in Los Angeles.

= Windows PowerShell =

== 1.0 ==

Named Windows PowerShell, version 1.0 was released in November 2006 for Windows XP SP2, Windows Server 2003 SP1 and Windows Vista{{cite web |url=https://devblogs.microsoft.com/powershell/its-a-wrap-windows-powershell-1-0-released |title=It's a Wrap! Windows PowerShell 1.0 Released! |publisher=Microsoft |work=Windows PowerShell Blog |date=November 14, 2006 |first1=Leonard |last1=Chung |first2=Jeffrey |last2=Snover |first3=Arul |last3=Kumaravel }} and as an optional component of Windows Server 2008.

== 2.0 ==

File:GPowerShell.PNG, an integrated development environment for PowerShell scripts]]

Version 2.0 integrates with Windows 7 and Windows Server 2008 R2{{cite web |url=http://blogs.msdn.com/powershell/archive/2008/10/28/powershell-will-be-installed-by-default-on-windows-server-08-r2-ws08r2-and-windows-7-w7.aspx |title=PowerShell will be installed by default on Windows Server 08 R2 (WS08R2) and Windows 7 (W7)! |work=Windows PowerShell Blog |publisher=Microsoft |date=October 28, 2008 |access-date=September 27, 2011}} and is released for Windows XP with Service Pack 3, Windows Server 2003 with Service Pack 2, and Windows Vista with Service Pack 1.{{cite web

| url = http://blogs.msdn.com/powershell/archive/2009/10/27/windows-management-framework-is-here.aspx

| title = Windows Management Framework is here!

| date = October 27, 2009

| access-date = October 30, 2009

}}{{cite web|url=http://support.microsoft.com/kb/968929 |title=Microsoft Support Knowledge Base: Windows Management Framework (Windows PowerShell 2.0, WinRM 2.0, and BITS 4.0) |publisher=Support.microsoft.com |date=September 23, 2011 |access-date=September 27, 2011}}

The version includes changes to the language and hosting API, in addition to including more than 240 new cmdlets.{{cite web |url=http://blogs.msdn.com/powershell/archive/2008/10/29/574-reasons-why-we-are-so-proud-and-optimistic-about-w7-and-ws08r2.aspx |title=574 Reasons Why We Are So Proud and Optimistic About W7 and WS08R2 |work=Windows PowerShell Blog |publisher=Microsoft |date=October 29, 2008 |access-date=September 27, 2011}}{{cite web |last=Snover |first=Jeffrey |title=PowerShell: Creating Manageable Web Services |url=http://channel9.msdn.com/pdc2008/ES24/ |date=2008 |archive-url=https://web.archive.org/web/20081013065033/http://channel9.msdn.com/pdc2008/ES24/ |archive-date=October 13, 2008 |access-date=July 19, 2015}}

New features include:{{cite web | url = http://blogs.msdn.com/powershell/archive/2007/11/06/what-s-new-in-ctp-of-powershell-2-0.aspx | title = What's New in CTP of PowerShell 2.0 | access-date = November 28, 2007}}{{cite web|url=http://www.microsoft.com/downloads/details.aspx?FamilyId=7C8051C2-9BFC-4C81-859D-0864979FA403&displaylang=en |title=Windows PowerShell V2 Community Technology Preview 2 (CTP2) – releaseNotes |website=Microsoft |access-date=May 5, 2008 |url-status=dead |archive-url=https://web.archive.org/web/20080506150324/http://www.microsoft.com/downloads/details.aspx?FamilyID=7c8051c2-9bfc-4c81-859d-0864979fa403&DisplayLang=en |archive-date=May 6, 2008 }}{{cite web | url = http://activexperts.com/admin/powershell/ps1vs2/ | title = Differences between PowerShell 1.0 and PowerShell 2.0 | access-date = June 26, 2010 | archive-date = September 17, 2010 | archive-url = https://web.archive.org/web/20100917075605/http://activexperts.com/admin/powershell/ps1vs2/ | url-status = dead }}

  • Remoting: Using WS-Management, Allows scripts and cmdlets to be invoked on a remote machine or a large set of remote machines.
  • Background jobs: Also called a PSJob, it allows a command sequence (script) or pipeline to be invoked asynchronously. Jobs can be run on the local machine or on multiple remote machines. An interactive cmdlet in a PSJob blocks the execution of the job until user input is provided.
  • Transactions: Enable cmdlet and developers can perform transactional operations. Includes transaction cmdlets for starting, committing, and rolling back a PSTransaction as well as features to manage and direct the transaction to the participating cmdlet and provider operations. The PowerShell Registry provider supports transactions.
  • Advanced functions: Initially called "script cmdlets", these bundled cmdlets was later renamed "advanced functions".{{cite web |url=https://technet.microsoft.com/en-us/library/ff677563.aspx |title=Windows PowerShell: Writing Cmdlets in Script |last=Jones |first=Don |publisher=Microsoft |date=May 2010 |website=TechNet Magazine}}
  • SteppablePipelines: This allows the user to control when the BeginProcessing(), ProcessRecord() and EndProcessing() functions of a cmdlet are called.
  • Modules: Allows script developers and administrators to organize and partition scripts in self-contained, reusable units. Code from a module executes in its own self-contained context and does not affect the state outside the module. Modules can define a restricted runspace environment by using a script. They have a persistent state as well as public and private members.
  • Data language: A domain-specific subset of the language that allows data definitions to be decoupled from the scripts and allows localized string resources to be imported into the script at runtime (Script Internationalization).
  • Script debugging: Allows breakpoints to be set in a script or function. Breakpoints can be set on lines, line & columns, commands and read or write access of variables. It includes a set of cmdlets to control the breakpoints via script.
  • Eventing: Allows listening, forwarding, and acting on management and system events. Eventing allows hosts to be notified about state changes to their managed entities. It also enables scripts to subscribe to ObjectEvents, PSEvents, and WmiEvents and process them synchronously and asynchronously.
  • Integrated Scripting Environment (ISE): GUI-based host that provides integrated debugger, syntax highlighting, tab completion and up to 8 Unicode-enabled consoles (Runspaces) in a tabbed UI, as well as the ability to run only the selected parts in a script.
  • Network file transfer: Native support for prioritized, throttled, and asynchronous transfer of files between machines using the Background Intelligent Transfer Service (BITS).{{cite web |url=http://blogs.msdn.com/powershell/archive/2008/10/14/gogrid-snap-in-managing-cloud-services-with-powershell.aspx |title=GoGrid Snap-in – Managing Cloud Services with PowerShell |work=Windows PowerShell Blog |publisher=Microsoft |date=October 14, 2008 |access-date=September 27, 2011}}
  • New cmdlets: Including Out-GridView, which displays tabular data in the WPF GridView object, on systems that allow it, and if ISE is installed and enabled.
  • New operators: -Split, -Join, and Splatting (@) operators.
  • Exception handling with Try-Catch-Finally: Unlike other .NET languages, this allows multiple exception types for a single catch block.
  • Nestable Here-Strings: Here-Strings have been improved and can now nest.{{cite web |url=http://blogs.msdn.com/powershell/archive/2008/10/18/emit-xml.aspx |title=Emit-XML |work=Windows PowerShell Blog |publisher=Microsoft |date=October 17, 2008 |access-date=September 27, 2011}}
  • Block comments: Support for block comments using <# and #> as delimiters.{{cite web |url=http://blogs.msdn.com/powershell/archive/2008/06/14/block-comments-in-v2.aspx |title=Block Comments in V2 |work=Windows PowerShell Blog |publisher=Microsoft |date=June 14, 2008 |access-date=September 27, 2011}}
  • New APIs: The new APIs range from handing more control over the parser and runtime to the host, to creating and managing collection of Runspaces (RunspacePools) as well as the ability to create Restricted Runspaces which only allow a configured subset of PowerShell to be invoked. The new APIs also support participation in a transaction

== 3.0 ==

Version 3.0 integrates with Windows 8, Windows Server 2012, Windows 7 with Service Pack 1, Windows Server 2008 with Service Pack 1, and Windows Server 2008 R2 with Service Pack 1.{{cite web

| url = http://tfl09.blogspot.co.uk/2012/08/powershell-version-3-is-rtm.html

| last = Lee

| first = Thomas

| title = PowerShell Version 3 is RTM!

| work = Under The Stairs

| date = August 13, 2012

| access-date = August 13, 2012

}}{{cite web|title=Windows Management Framework 3.0|url=http://www.microsoft.com/en-us/download/details.aspx?id=34595|work=Download Center|publisher=Microsoft|access-date=November 8, 2012|date=September 4, 2012}}

Version 3.0 is part of a larger package, [https://www.microsoft.com/en-in/download/details.aspx?id=34595 Windows Management Framework] 3.0 (WMF3), which also contains the WinRM service to support remoting. Microsoft made several Community Technology Preview releases of WMF3. An early community technology preview 2 (CTP 2) version of Windows Management Framework 3.0 was released on December 2, 2011.{{cite web |url=http://blogs.msdn.com/b/powershell/archive/2011/12/02/windows-management-framework-3-0-community-technology-preview-ctp-2-available-for-download.aspx |title=Windows Management Framework 3.0 Community Technology Preview (CTP) #2 Available for Download |work=Windows PowerShell Blog |publisher=Microsoft |date=December 2, 2011}} Windows Management Framework 3.0 was released for general availability in December 2012{{cite web |url=https://www.microsoft.com/en-us/download/details.aspx?id=34595|title=Windows Management Framework 3.0 |work=Download Center |publisher=Microsoft |date=December 3, 2012}} and is included with Windows 8 and Windows Server 2012 by default.{{cite web |url=https://msdn.microsoft.com/en-us/powershell/scripting/setup/windows-powershell-system-requirements |title=Windows PowerShell System Requirements |last=Jofre |first=JuanPablo |publisher=Microsoft |date=December 14, 2016 |website=Microsoft Developer Network |access-date=April 20, 2017}}

New features include:{{cite book|last=Honeycutt|first=Jerry|title=Introducing Windows 8: An Overview for IT Professionals|year=2012|publisher=Microsoft Press|location=Redmond, WA|isbn=978-0-7356-7050-1|url=http://blogs.msdn.com/b/microsoft_press/archive/2012/11/13/free-ebook-introducing-windows-8-an-overview-for-it-professionals-final-edition.aspx|editor-last=Woolley |editor-first=Valerie}}{{Rp|33–34}}

  • Scheduled jobs: Jobs can be scheduled to run on a preset time and date using the Windows Task Scheduler infrastructure.
  • Session connectivity: Sessions can be disconnected and reconnected. Remote sessions have become more tolerant of temporary network failures.
  • Improved code writing: Code completion (IntelliSense) and snippets are added. ISE allows users to use dialog boxes to fill in parameters for cmdlets.
  • Delegation support: Administrative tasks can be delegated to users who do not have permissions for that type of task, without granting them perpetual additional permissions.
  • Help update: Help documentations can be updated via Update-Help command.
  • Automatic module detection: Modules are loaded implicitly whenever a command from that module is invoked. Code completion works for unloaded modules as well.
  • New commands: Dozens of new modules were added, including functionality to manage disks get-WmiObject win32_logicaldisk, volumes, firewalls, network connections, and printers, which had previously been performed via WMI.{{Explain|date=January 2014}}

== 4.0 ==

Version 4.0 integrates with Windows 8.1, Windows Server 2012 R2, Windows 7 SP1, Windows Server 2008 R2 SP1 and Windows Server 2012.{{cite web|title=Windows Management Framework 4.0 is now available|url=http://blogs.msdn.com/b/powershell/archive/2013/10/25/windows-management-framework-4-0-is-now-available.aspx|publisher=Microsoft|access-date=November 4, 2013|date=October 24, 2013}}

New features include:

  • Desired State Configuration:{{cite web|last=Levy|first=Shay|title=New Features in Windows PowerShell 4.0|url=http://www.powershellmagazine.com/2013/06/25/new-features-in-windows-powershell-4-0/|work=PowerShell Magazine|access-date=June 26, 2013|date=June 25, 2013}}{{cite web|title=Desired State Configuration in Windows Server 2012 R2 PowerShell|url=http://channel9.msdn.com/Events/TechEd/NorthAmerica/2013/MDC-B302#fbid=sBK5uHH2bcL|work=Channel 9|publisher=Microsoft|access-date=June 26, 2013|date=June 3, 2013|archive-date=December 26, 2013|archive-url=https://web.archive.org/web/20131226224907/http://channel9.msdn.com/Events/TechEd/NorthAmerica/2013/MDC-B302#fbid=sBK5uHH2bcL|url-status=dead}}{{cite web|last=Hall|first=Adrian|title=Thoughts from Microsoft TechEd North America|url=http://blogs.splunk.com/2013/06/07/thoughts-from-microsoft-teched-north-america/|work=Blogs: Tips & Tricks|publisher=Splunk|access-date=June 26, 2013|date=June 7, 2013}} Declarative language extensions and tools that enable the deployment and management of configuration data for systems using the DMTF management standards and WS-Management Protocol
  • New default execution policy: On Windows Servers, the default execution policy is now RemoteSigned.
  • Save-Help: Help can now be saved for modules that are installed on remote computers.
  • Enhanced debugging: The debugger now supports debugging workflows, remote script execution and preserving debugging sessions across session reconnections.
  • -PipelineVariable switch: A new ubiquitous parameter to expose the current pipeline object as a variable for programming purposes
  • Network diagnostics to manage physical and Hyper-V's virtualized network switches
  • Where and ForEach method syntax provides an alternate method of filtering and iterating over objects.

== 5.0 ==

File:PowerShell 5.0 icon.png

Version 5.0 was re-released with Windows Management Framework (WMF) 5.0 on February 24, 2016, following an initial release with a severe bug.{{cite web|title=Windows Management Framework (WMF) 5.0 RTM packages has been republished|url=https://blogs.msdn.microsoft.com/powershell/2016/02/24/windows-management-framework-wmf-5-0-rtm-packages-has-been-republished/|website=Windows PowerShell Blog|publisher=Microsoft|date=February 24, 2016}}

Key features included:

  • The new class keyword that creates classes for object-oriented programming
  • The new enum keyword that creates enums
  • OneGet cmdlets to support the Chocolatey package manager{{cite web|url=https://github.com/OneGet/oneget/wiki/Q-and-A|title=Q and A|work=GitHub|access-date=April 21, 2015}}
  • Extending support for switch management to layer 2 network switches.{{cite web |title=Windows Management Framework V5 Preview |url=http://blogs.technet.com/b/windowsserver/archive/2014/04/03/windows-management-framework-v5-preview.aspx |work=blogs.technet.com |publisher=Microsoft |first=Jeffrey |last=Snover |date=April 3, 2014 |access-date=April 21, 2015 |archive-url=https://web.archive.org/web/20140630174828/http://blogs.technet.com/b/windowsserver/archive/2014/04/03/windows-management-framework-v5-preview.aspx |archive-date=June 30, 2014 |url-status=dead }}
  • Debugging for background jobs and instances hosted in other processes (each of which is called a "runspace")
  • Desired State Configuration (DSC) Local Configuration Manager (LCM) version 2.0
  • DSC partial configurations
  • DSC Local Configuration Manager meta-configurations
  • Authoring of DSC resources using classes

=== 5.1 ===

Version 5.1 was released along with the Windows 10 Anniversary Update{{cite web|url=http://www.powershellmagazine.com/2016/08/02/pstip-new-powershell-commands-in-windows-10-anniversary-update/|title=#PSTip New PowerShell Commands in Windows 10 Anniversary Update|first=Jaap Brasser|last=says|date=August 2, 2016}} on August 2, 2016, and in Windows Server 2016.{{cite web|url=https://blogs.technet.microsoft.com/ausoemteam/2016/09/04/whats-new-in-windows-server-2016-standard-edition-part-9-management-and-automation/|title=What's New In Windows Server 2016 Standard Edition Part 9 – Management And Automation|date=September 4, 2016 }} PackageManagement now supports proxies, PSReadLine now has ViMode support, and two new cmdlets were added: Get-TimeZone and Set-TimeZone. The LocalAccounts module allows for adding/removing local user accounts.{{cite web|url=https://technet.microsoft.com/en-us/library/mt651681.aspx|title=Microsoft.PowerShell.LocalAccounts Module|website=technet.microsoft.com|date=June 16, 2016 }} A preview for was released for Windows 7, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, and Windows Server 2012 R2 on July 16, 2016,{{cite web|url=https://blogs.msdn.microsoft.com/powershell/2016/07/16/announcing-windows-management-framework-wmf-5-1-preview/|title=Announcing Windows Management Framework (WMF) 5.1 Preview|date=July 16, 2016}} and was released on January 19, 2017.{{cite web|url=https://www.microsoft.com/en-us/download/details.aspx?id=54616|title=WMF 5.1|website=Microsoft Download Center}}

Version 5.1 is the first to come in two editions of "Desktop" and "Core". The "Desktop" edition is the continuation product line that uses the .NET Framework, and the "Core" edition runs on .NET Core and is bundled with Windows Server 2016 Nano Server. In exchange for smaller footprint, the latter lacks some features such as the cmdlets to manage clipboard or join a computer to a domain, WMI version 1 cmdlets, Event Log cmdlets and profiles. This was the final version exclusively for Windows. Version 5.1 remains pre-installed on Windows 10, Windows 11 and Windows Server 2022, while the .NET version needs to be installed separately and can run side-by-side with the .NET Framework version.{{Cite web |date=March 7, 2024 |title=What is Windows PowerShell? - PowerShell |url=https://learn.microsoft.com/en-us/powershell/scripting/what-is-windows-powershell?view=powershell-7.4 |access-date=August 19, 2024 |website=Microsoft Learn |language=en-us}}{{Cite web |date=April 2, 2024 |title=Migrating from Windows PowerShell 5.1 to PowerShell 7 - PowerShell |url=https://learn.microsoft.com/en-us/powershell/scripting/whats-new/migrating-from-windows-powershell-51-to-powershell-7?view=powershell-7.4#using-powershell-7-side-by-side-with-windows-powershell-51 |access-date=August 19, 2024 |website=Microsoft Learn |language=en-us}}

= PowerShell Core =

== 6.0 ==

Renamed to PowerShell Core, version 6.0 was first announced on August 18, 2016, when Microsoft unveiled its decision to make the product cross-platform, independent of Windows, free and open source. It achieved general availability on January 10, 2018, for Windows, macOS and Linux.{{cite web |last1=Aiello |first1=Joey |title=PowerShell Core 6.0: Generally Available (GA) and Supported! |url=https://blogs.msdn.microsoft.com/powershell/2018/01/10/powershell-core-6-0-generally-available-ga-and-supported/ |website=PowerShell Team Blog |publisher=Microsoft |access-date=June 11, 2018 |ref=1 |archive-url=https://archive.today/20180611172006/https://blogs.msdn.microsoft.com/powershell/2018/01/10/powershell-core-6-0-generally-available-ga-and-supported/ |archive-date=June 11, 2018 |date=January 11, 2018 |url-status=live }} It has its own support lifecycle and adheres to the Microsoft lifecycle policy that is introduced with Windows 10: Only the latest version of PowerShell Core is supported. Microsoft expects to release one minor version for PowerShell Core 6.0 every six months.{{cite web |last1=Aiello |first1=Joey |last2=Wheeler |first2=Sean |title=PowerShell Core Support Lifecycle |url=https://docs.microsoft.com/en-us/powershell/scripting/PowerShell-Core-Support?view=powershell-6 |website=Microsoft Docs |publisher=Microsoft |date=January 10, 2018 |access-date=January 11, 2018 |archive-date=November 16, 2018 |archive-url=https://web.archive.org/web/20181116013534/https://docs.microsoft.com/en-us/powershell/scripting/powershell-core-support?view=powershell-6 |url-status=dead }}

The most significant change in this version is the expansion to the other platforms. For Windows administrators, this version did not include any major new features. In an interview with the community on January 11, 2018, the development team was asked to list the top 10 most exciting things that would happen for a Windows IT professional who would migrate from version 5.1 to version 6.0. In response, Angel Calvo of Microsoft could only name two: cross-platform and open-source.{{cite web|last1=Calvo|first1=Angel|title=Top 10 most exciting reasons to migrate|url=https://techcommunity.microsoft.com/t5/PowerShell-AMA/Top-10-most-exciting-reasons-to-migrate/m-p/143960#M25|website=PowerShell AMA|publisher=Microsoft|date=January 11, 2018}} PowerShell 6 changed to UTF-8 as default encoding, with some exceptions.{{Cite web |last=sdwheeler |date=August 3, 2023 |title=What's New in PowerShell Core 6.0 |url=https://learn.microsoft.com/en-us/previous-versions/powershell/scripting/whats-new/what-s-new-in-powershell-core-60?view=powershell-7.1 |access-date=December 11, 2023 |website=learn.microsoft.com |language=en-us |quote=Default encoding is UTF-8 without a BOM except for New-ModuleManifest}} (version 7.4 changes more to UTF-8){{Cite web |date=November 29, 2023 |title=Understanding file encoding in VS Code and PowerShell - PowerShell |url=https://learn.microsoft.com/en-us/powershell/scripting/dev-cross-plat/vscode/understanding-file-encoding?view=powershell-7.4 |access-date=December 11, 2023 |website=learn.microsoft.com |language=en-us}}

=== 6.1 ===

According to Microsoft, one of the new features of version 6.1 is "Compatibility with 1900+ existing cmdlets in Windows 10 and Windows Server 2019."{{cite web |title=Announcing PowerShell Core 6.1 |url=https://devblogs.microsoft.com/powershell/announcing-powershell-core-6-1/ |work=devblogs.microsoft.com |publisher=Microsoft |first=Joey |last=Aiello|date=September 13, 2018 |access-date=June 1, 2019}} Still, no details of these cmdlets can be found in the full version of the change log.{{Cite web|title=PowerShell/PowerShell|url=https://github.com/PowerShell/PowerShell|access-date=June 22, 2020|website=GitHub|language=en}} Microsoft later professes that this number was insufficient as PowerShell Core failed to replace Windows PowerShell 5.1 and gain traction on Windows. It was, however, popular on Linux.

=== 6.2 ===

Version 6.2 is focused primarily on performance improvements, bug fixes, and smaller cmdlet and language enhancements that improved developer productivity.{{cite web |title=General Availability of PowerShell Core 6.2 |url=https://devblogs.microsoft.com/powershell/general-availability-of-powershell-core-6-2/ |work=devblogs.microsoft.com |publisher=Microsoft |first=Steve |last=Lee |date=March 28, 2019 |access-date=June 1, 2019}}

= PowerShell =

== 7.0 ==

Renamed to simply PowerShell, version 7 replaces the previous product lines: PowerShell Core and Windows PowerShell.{{cite web |title=Microsoft Releases PowerShell 7 Preview |url=https://redmondmag.com/articles/2019/05/30/powershell-7-preview-released.aspx |publisher=1105 Media Inc |first=Kurt |last=Mackie|date=May 30, 2019 |access-date=June 1, 2019}}{{cite web |title=The Next Release of PowerShell – PowerShell 7 |url=https://devblogs.microsoft.com/powershell/the-next-release-of-powershell-powershell-7/ |publisher=Microsoft |first=Steve |last=Lee|date=April 5, 2019 |access-date=June 1, 2019}} The focus in development was to make version 7 a viable replacement for version 5.1, i.e. to have near parity with it in terms of compatibility with modules that ship with Windows.{{cite web |title=PowerShell 7 Road Map |url=https://devblogs.microsoft.com/powershell/powershell-7-road-map/ |work=devblogs.microsoft.com | publisher=Microsoft |first=Steve |last=Lee|date=May 30, 2019 |access-date=August 12, 2020}}

New features include:{{Cite web |url=https://devblogs.microsoft.com/powershell/powershell-7-preview-5/ |title=PowerShell 7 Preview 5 {{!}} PowerShell |date=October 23, 2019 |access-date=March 5, 2020 |archive-date=February 15, 2020 |archive-url=https://web.archive.org/web/20200215113601/https://devblogs.microsoft.com/powershell/powershell-7-preview-5/ |url-status=live }}

  • The -Parallel switch for the ForEach-Object cmdlet to help handle parallel processing
  • A new error view
  • The Get-Error cmdlet
  • Pipeline chaining operators (&& and ||) that allow conditional execution of the next cmdlet in the pipeline
  • The ?: operator for ternary operation
  • The ?? operator for null coalescing
  • The ??= operator for null coalescing assignment
  • Cross-platform Invoke-DscResource (experimental)
  • Return of the Out-GridView cmdlet
  • Return of the -ShowWindow switch for the Get-Help

=== 7.2 ===

Version 7.2 is the next long-term support version, after version 7.0. It uses .NET 6.0 and features universal installer packages for Linux. On Windows, updates to version 7.2 and later come via the Microsoft Update service; this feature has been missing from versions 6.0 through 7.1.{{Cite web|url=https://www.itsfoss.net/powershell-7-2/|title=PowerShell 7.2 is the new version of Microsoft's next-generation shell |website=itsfoss.net|date=November 12, 2021}}

=== 7.3 ===

Version 7.3 includes some general Cmdlet updates and fixes, testing for framework dependent package in release pipeline as well as build and packaging improvements.{{Cite web |url=https://github.com/PowerShell/PowerShell/releases/tag/v7.3.0 |title=Release v7.3.0 Release of PowerShell · PowerShell/PowerShell |website=GitHub |access-date=March 7, 2022 |archive-date=November 9, 2022 |archive-url=https://web.archive.org/web/20221109021444/https://github.com/PowerShell/PowerShell/releases/tag/v7.3.0 |url-status=live }}

=== 7.4 ===

Version 7.4 is based on .NET 8 and is considered the long term support (LTS) release.{{Cite web |title=Release v7.4.7 Release of PowerShell · PowerShell/PowerShell |url=https://github.com/PowerShell/PowerShell/releases/tag/v7.4.7 |access-date=January 27, 2025 |website=GitHub |language=en}}

Changes include:{{Cite web |last=sdwheeler |date=January 23, 2025 |title=What's New in PowerShell 7.4 - PowerShell |url=https://learn.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-74?view=powershell-7.4 |access-date=January 27, 2025 |website=learn.microsoft.com |language=en-us}}

=== 7.5 ===

Version 7.5, is the latest stable release; released January 2025; built on .NET 9.0.1. It includes enhancements for performance, usability, and security.{{Cite web |last=sdwheeler |date=January 23, 2025 |title=What's New in PowerShell 7.5 - PowerShell |url=https://learn.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-75?view=powershell-7.5 |access-date=January 27, 2025 |website=learn.microsoft.com |language=en-us}} Key updates include improvements to tab completion, such as better type inference and new argument completers, as well as fixes for Invoke-WebRequest and Invoke-RestMethod. This release also adds the new ConvertTo-CliXml and ConvertFrom-CliXml cmdlets, and updates core modules like PSReadLine and Microsoft.PowerShell.PSResourceGet. Breaking changes include updates to Test-Path parameter handling, and default settings for New-FileCatalog.

Prior to GA Release there were 5 preview releases and 1 RC release of PowerShell v7.5.0,{{Cite web |title=Release v7.5.0 Release of PowerShell · PowerShell/PowerShell |url=https://github.com/PowerShell/PowerShell/releases/tag/v7.5.0 |access-date=January 27, 2025 |website=GitHub |language=en}} with a full release blog post for this version expected soon.

=== 7.6 ===

Version 7.6 is based on .NET 9 and is the latest preview release. The first preview release v7.6.0-preview.2{{Cite web |title=Release v7.6.0-preview.2 Release of PowerShell · PowerShell/PowerShell |url=https://github.com/PowerShell/PowerShell/releases/tag/v7.6.0-preview.2 |access-date=January 27, 2025 |website=GitHub |language=en}} was released on January 15, 2025.

Changes include: TBD{{Cite web |last=sdwheeler |date=January 17, 2025 |title=What's New in PowerShell 7.6 - PowerShell |url=https://learn.microsoft.com/en-us/powershell/scripting/whats-new/what-s-new-in-powershell-76?view=powershell-7.6 |access-date=January 27, 2025 |website=learn.microsoft.com |language=en-us}}

Comparison of cmdlets with similar commands

The following table contains various cmdlets that ship with PowerShell that have notably similar functionality to commands in other shells. Many of these cmdlets are exposed to the user via predefined aliases to make their use familiar to users of the other shells.

{{Table alignment}}

class="wikitable sortable defaultcenter col5left" style="font-size: small;"

|+Comparison of cmdlets with commands of other shells

scope="col" style=width:130px;| Cmdlet

! scope="col" class="unsortable" | Predefined
alias

! scope="col" | Command Prompt
command

! scope="col" | Unix shell
command

! scope="col" class="unsortable"| Functionality

scope="row" | {{mono|Clear-Host}}{{efn|implemented as a predefined function}}

| {{mono|cls}}, {{mono|clear}}

| {{mono|cls}}

| {{mono|clear}}

|Clears the screen

scope="row" | {{mono|Copy-Item}}

| {{mono|cpi}}, {{mono|copy}}, {{mono|cp}}

| {{mono|copy}}

| {{mono|cp}}

|Copies files and folders

scope="row" | {{mono|Get-ChildItem}}

| {{mono|gci, dir, ls}}{{efn|ls is absent from the Linux version of PowerShell Core}}

| {{mono|dir}}

| {{mono|ls}}

|Lists files and folders

scope="row" | {{mono|Get-Command}}

| {{mono|gcm}}

| {{mono|help}}, {{mono|where}}

| {{mono|type}}, {{mono|which}}, {{mono|compgen}}

|Lists available commands and gets command path

scope="row" | {{mono|Get-Content}}

| {{mono|gc}}, {{mono|type}}, {{mono|cat}}

| {{mono|type}}

| {{mono|cat}}

|Reports the content of a file

scope="row" | {{mono|Get-Date}}

| {{none}}

| {{mono|date}} + {{mono|time}}

| {{mono|date}}

|Reports date and time

scope="row" | {{mono|Get-Help}}

| {{mono|help}}, {{mono|man}}{{efn|man is absent from the Linux version of PowerShell Core}}

| {{mono|help}}

| {{mono|apropos}}, {{mono|man}}

|Reports a command's documentation

scope="row" | {{mono|history (command)#PowerShell|Get-History}}

| {{mono|ghy}}, {{mono|h}}, {{mono|history}}

| {{mono|DOSKEY /HISTORY}}

| {{mono|fc -l}}, {{mono|history}}{{efn|fc is defined in the POSIX standard and history is not. However most Unix implementations also define history'.}}

|Lists previous commands

scope="row" | {{mono|Get-Location}}

| {{mono|gl}}, {{mono|pwd}}

| {{mono|cd}}

| {{mono|pwd}}

|Reports the working directory

scope="row" | {{mono|Get-Process}}

| {{mono|gps}}, {{mono|ps}}

| {{mono|tlist}},{{efn|name="Available tlist kill"|1=Available in Windows NT 4, Windows 98 Resource Kit, Windows 2000 Support Tools}} {{mono|tasklist}}{{efn|name="Available tasklist taskkill"|1=Introduced in Windows XP Professional Edition}}

| {{mono|ps}}

|Reports running processes

scope="row" | {{mono|Invoke-WebRequest}}

| {{mono|iwr}}, {{mono|curl}}, {{mono|wget}}{{efn|curl and wget are absent from PowerShell Core, so as to not interfere with similarly named native commands}}

| {{mono|curl}}{{Cite web |url=https://techcommunity.microsoft.com/t5/Containers/Tar-and-Curl-Come-to-Windows/ba-p/382409 |title=Tar and Curl Come to Windows! - Microsoft Tech Community - 382409 |date=March 22, 2019 |access-date=May 17, 2020 |archive-date=September 11, 2020 |archive-url=https://web.archive.org/web/20200911181923/https://techcommunity.microsoft.com/t5/containers/tar-and-curl-come-to-windows/ba-p/382409 |url-status=live }}

| {{mono|wget}}, {{mono|curl}}

|Downloads contents from the Internet

scope="row" | {{mono|Move-Item}}

| {{mono|mi}}, {{mono|move}}, {{mono|mv}}

| {{mono|move}}

| {{mono|mv}}

|Moves files and folders

scope="row" | {{mono|Pop-Location}}

| {{mono|popd}}

| {{mono|popd}}

| {{mono|popd}}

|Reverts the working directory to the path last pushed

scope="row" | {{mono|Push-Location}}

| {{mono|pushd}}

| {{mono|pushd}}

| {{mono|pushd}}

|Pushes the working directory path and changes the working directory

scope="row" | {{mono|Read-Host}}

| {{none}}

| {{mono|[https://ss64.com/nt/set.html set /P]}}

| {{mono|read}}

|Reads input into a variable from the command line

scope="row" | {{mono|Remove-Item}}

| {{mono|ri}}, {{mono|del}}, {{mono|erase}}, {{mono|rmdir}}, {{mono|rd}}, {{mono|rm}}

| {{mono|del}}, {{mono|erase}}, {{mono|rmdir}}, {{mono|rd}}

| {{mono|rm}}, {{mono|rmdir}}

|Deletes files or folders

scope="row" | {{mono|Rename-Item}}

| {{mono|rni}}, {{mono|ren}}

| {{mono|ren}}, {{mono|rename}}

| {{mono|mv}}

|Renames a file or folder

scope="row" | {{mono|Register-ScheduledJob}}

| {{n/a}}

| {{mono|at, schtasks{{cite web | author= | title=Schtasks.exe |url=https://learn.microsoft.com/en-us/windows/win32/taskschd/schtasks| date=March 12, 2023 | access-date=May 25, 2025}}

| {{mono|at, cron}}

| Schedule tasks to be run at a different time

scope="row" | {{mono|Select-String}}

| {{mono|sls}}

| {{mono|find}}, {{mono|findstr}}

| {{mono|grep}}

|Reports lines of a file that match a pattern

scope="row" | {{mono|Set-Date}}

| {{none}}

| {{mono|date}} + {{mono|time}}

| {{mono|date -s}}

|Resets the date and time

scope="row" | {{mono|Set-Location}}

| {{mono|sl}}, {{mono|cd}}, {{mono|chdir}}

| {{mono|cd}}, {{mono|chdir}}

| {{mono|cd}}

|Changes the working path

scope="row" | {{mono|Set-Variable}}

| {{mono|sv}}, {{mono|set}}

| {{mono|set}}

| {{mono|env}}, {{mono|export}}, {{mono|set}}, {{mono|setenv}}

|Creates or alters the contents of an environment variable

scope="row" | {{mono|[https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/sort-object Sort-Object]}}

| {{mono|sort}}

| {{mono|[https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/sort sort]}}

| {{mono|sort}}

|Sorts lines of text; cmdlet also sorts objects

scope="row" | {{mono|Stop-Process}}

| {{mono|spps}}, {{mono|kill}}

| {{mono|kill}},{{efn|name="Available tlist kill"}} {{mono|taskkill}}{{efn|name="Available tasklist taskkill"}}

| {{mono|kill}}{{efn|name="UNIX kill misnomer"|1=Also used in UNIX to send a process any signal, the "Terminate" signal is merely the default}}

|Stops a running process

scope="row" | {{mono|Tee-Object}}

| {{mono|tee}}

| {{n/a}}

| {{mono|tee}}

|Pipes input to a file or variable, passing the input along the pipeline

scope="row" | {{mono|Test-Connection{{efn|1=While the external ping command remains available to PowerShell, Test-Connection's output is a structured object that can be programmatically inspected.{{cite web|title=Test-Connection|url=https://technet.microsoft.com/en-us/library/hh849808.aspx|website=PowerShell documentations|publisher=Microsoft|date=August 9, 2015}}}}}}

| {{mono|ping}}

| {{mono|ping}}

| {{mono|ping}}

|Sends ICMP echo requests to a remote machine

scope="row" | {{mono|Write-Output}}

| {{mono|echo}}, {{mono|write}}

| {{mono|echo}}

| {{mono|echo}}

|Writes text to standard output

Notes

{{Notelist}}

Filename extensions <span class="anchor" id="Extensions"></span>

class="wikitable"

! Extension

! Description

.ps1Script file{{cite web |last1=Wheeler |first1=Sean |title=About Scripts |url=https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_scripts?view=powershell-7.1 |website=Microsoft Docs |publisher=Microsoft |date=June 2, 2020}}
.psd1Module's manifest file; usually comes with a script module or binary module{{cite web |last1=Wheeler |first1=Sean |last2=Smatlak |first2=David |last3=Wilson |first3=Chase |title=How to write a PowerShell module manifest |url=https://docs.microsoft.com/en-us/powershell/scripting/developer/module/how-to-write-a-powershell-module-manifest?view=powershell-7 |website=Docs |publisher=Microsoft |date=October 16, 2019}}
.psm1Script module file{{cite web |last1=Wheeler |first1=Sean |last2=Smatlak |first2=David |title=How to Write a PowerShell Script Module |url=https://docs.microsoft.com/en-us/powershell/scripting/developer/module/how-to-write-a-powershell-script-module?view=powershell-7 |website=Microsoft Docs |publisher=Microsoft |date=November 22, 2019}}
.ps1xmlFormat and type definitions file{{cite web |last1=Wheeler |first1=Sean |last2=Jofre |first2=Juan Pablo |last3=Vorobev |first3=Sergei |last4=Nikolaev |first4=Kirill |last5=Coulter |first5=David |title=About Types.ps1xml |url=https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_types.ps1xml?view=powershell-7 |website=Microsoft Docs |publisher=Microsoft |date=June 2, 2020}}
.psc1Console file{{cite web |last1=Wheeler |first1=Sean |last2=Jofre |first2=Juan Pablo |last3=Vorobev |first3=Sergei |last4=Nikolaev |first4=Kirill |last5=Coulter |first5=David |title=Export-Console |url=https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/export-console?view=powershell-5.1 |website=Microsoft Docs |publisher=Microsoft}}
.psscSession configuration file{{cite web |last1=Wheeler |first1=Sean |title=About Session Configuration Files |url=https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_session_configuration_files?view=powershell-7 |website=Microsoft Docs |publisher=Microsoft |date=June 2, 2020}}
.psrcRole Capability file{{cite web |last1=Wheeler |first1=Sean |title=New-PSRoleCapabilityFile |url=https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/new-psrolecapabilityfile?view=powershell-7 |website=Microsoft Docs |publisher=Microsoft |date=June 2, 2020}}

Application support

class="wikitable sortable"
Application

! Version

! data-sort-type="number" | Cmdlets

! Provider

! Management GUI

Exchange Server

|2007

|{{Yes|402}}

|{{Yes}}

|{{Yes}}

Windows Server

|2008

|{{Yes}}

|{{Yes}}

|{{No}}

Microsoft SQL Server

|2008

|{{Yes}}

|{{Yes}}

|{{No}}

Microsoft SharePoint

|2010

|{{Yes}}

|{{Yes}}

|{{No}}

System Center Configuration Manager

|2012 R2

|{{Yes|400+}}

|{{Yes}}

|{{No}}

System Center Operations Manager

|2007

|{{Yes|74}}

|{{Yes}}

|{{No}}

System Center Virtual Machine Manager

|2007

|{{Yes}}

|{{Yes}}

|{{Yes}}

System Center Data Protection Manager

|2007

|{{Yes}}

|{{No}}

|{{No}}

Windows Compute Cluster Server

|2007

|{{Yes}}

|{{Yes}}

|{{No}}

Microsoft Transporter Suite for Lotus Domino{{cite web | url = http://www.microsoft.com/downloads/details.aspx?familyid=35fc4205-792b-4306-8e4b-0de9cce72172&displaylang=en | title = Microsoft Transporter Suite for Lotus Domino | website = Microsoft | access-date = March 7, 2008}}

|08.02.0012

|{{Yes|47}}

|{{No}}

|{{No}}

Microsoft PowerTools for Open XML{{cite web | url = http://www.codeplex.com/PowerTools | title = PowerTools for Open XML | access-date = June 20, 2008}}

|1.0

|{{Yes|33}}

|{{No}}

|{{No}}

IBM WebSphere MQ{{cite web | url = http://www-1.ibm.com/support/docview.wss?rs=171&uid=swg24017698 | title = MO74: WebSphere MQ – Windows PowerShell Library | access-date = December 5, 2007}}

|6.0.2.2

|{{Yes|44}}

|{{No}}

|{{No}}

IoT Core Add-ons{{cite web | url = https://docs.microsoft.com/en-us/windows-hardware/manufacture/iot/iot-core-adk-addons-command-line-options | title = IoT Core Add-ons command-line options | date = October 15, 2018 | access-date = June 13, 2020}}

|

|{{Yes|74}}

|{{Unknown}}

|{{Unknown}}

Quest Management Shell for Active Directory{{cite web | url = http://www.quest.com/powershell/activeroles-server.aspx | title = PowerShell Commands for Active Directory by Quest Software | access-date = July 2, 2008}}

|1.7

|{{Yes|95}}

|{{No}}

|{{No}}

Special Operations Software Specops Command{{cite web | url = http://www.specopssoft.com/powershell/ | title = PowerShell Remoting through Group Policy | access-date = December 7, 2007}}

|1.0

|{{Yes}}

|{{No}}

|{{Yes}}

VMware vSphere PowerCLI{{cite web | url = https://www.vmware.com/go/PowerCLI | archive-url = https://archive.today/20141230022901/https://www.vmware.com/go/PowerCLI | url-status = dead | archive-date = December 30, 2014 | title = VMware vSphere PowerCLI | access-date = September 9, 2014 }}

|6.5 R1

|{{Yes|500+}}

|{{Yes}}

|{{Yes}}

Internet Information Services{{cite web | url = https://blogs.msdn.com/powershell/archive/2008/07/03/iis7-powershell-provider-tech-preview-2.aspx | work = Windows PowerShell blog |title = IIS7 PowerShell Provider Tech Preview 2 | access-date = July 3, 2008 |archive-url = https://web.archive.org/web/20100204104602/https://blogs.msdn.com/powershell/archive/2008/07/03/iis7-powershell-provider-tech-preview-2.aspx |archive-date = February 4, 2010}}

|7.0

|{{Yes|54}}

|{{Yes}}

|{{No}}

Windows 7 Troubleshooting Center{{cite web | url = http://blogs.msdn.com/powershell/archive/2009/06/14/kudos-to-the-win7-diagnostics-team.aspx | title = Kudos to the Win7 Diagnostics Team | access-date = June 15, 2009}}

|6.1

|{{Yes}}

|{{No}}

|{{Yes}}

Microsoft Deployment Toolkit{{cite web|url=http://blogs.technet.com/b/mniehaus/archive/2009/07/10/mdt-2010-new-feature-16-powershell-support.aspx|title=MDT 2010 New Feature #16: PowerShell support|first=Niehaus |last=Michael|date=July 10, 2009|access-date=October 27, 2014}}

|2010

|{{Yes}}

|{{Yes}}

|{{Yes}}

NetApp PowerShell Toolkit{{cite web | url = http://blogs.msdn.com/b/powershell/archive/2010/06/16/kudos-to-netapp-for-data-ontap-powershell-toolkit.aspx | title = Kudos to NetApp for Data ONTAP PowerShell ToolKit | access-date = June 15, 2010}}{{cite web|url=http://community.netapp.com/t5/Microsoft-Cloud-and-Virtualization-Discussions/NetApp-PowerShell-Toolkit-4-2-released/m-p/120539|title=PowerShell Toolkit 4.2 Announcement|date=June 23, 2016|access-date=September 7, 2016}}

|4.2

|{{Yes|2000+}}

|{{Yes}}

|{{Yes}}

JAMS Scheduler – Job Access & Management System{{cite web | url = http://blogs.msdn.com/b/powershell/archive/2007/06/28/heterogeneous-job-scheduling-with-powershell.aspx | title = Heterogeneous Job Scheduling With PowerShell | access-date = September 15, 2010}}

|5.0

|{{Yes|52}}

|{{Yes}}

|{{Yes}}

UIAutomation{{cite web | url = http://uiautomation.codeplex.com/ | title = UIAutomation PowerShell Extensions | access-date = February 16, 2012 | archive-date = August 17, 2016 | archive-url = https://web.archive.org/web/20160817204820/http://uiautomation.codeplex.com/ | url-status = dead }}

|0.8

|{{Yes|432}}

|{{No}}

|{{No}}

Dell Equallogic{{cite web | url = http://en.community.dell.com/techcenter/storage/w/wiki/2688.aspx | title = EqualLogic HIT-ME with PowerShell | access-date = March 9, 2012}}

|3.5

|{{Yes|55}}

|{{No}}

|{{No}}

LOGINventory:de:LOGINventory

|5.8

|{{Yes}}

|{{Yes}}

|{{Yes}}

SePSX{{cite web | url = http://sepsx.codeplex.com | archive-url = https://archive.today/20130119175212/http://sepsx.codeplex.com/ | url-status = dead | archive-date = January 19, 2013 | title = Selenium PowerShell eXtensions | access-date = August 20, 2012 }}

|0.4.1

|{{Yes|39}}

|{{No}}

|{{No}}

See also

References

{{Reflist|30em|refs=

{{cite web | url = https://stackoverflow.com/questions/tagged/powershell | title = powershell | access-date = March 13, 2023 }}

}}

Further reading

  • {{Cite book |last=Finke |first=Douglas |title=Windows PowerShell for Developers |isbn=978-1-4493-2270-0 |year=2012 |publisher=O'Reilly Media |ref=none}}
  • {{Cite book |last=Holmes |first=Lee |year=2006 |title=Windows PowerShell Quick Reference |isbn=0-596-52813-2 |publisher=O'Reilly Media |ref=none}}
  • {{Cite book |last=Holmes |first=Lee |year=2007 |title=Windows PowerShell Cookbook |isbn=978-0-596-52849-2 |publisher=O'Reilly Media |ref=none}}
  • {{Cite book |last1=Jones |first1=Don |last2=Hicks |first2=Jeffery |title=Windows PowerShell 2.0: TFM |isbn=978-0-9821314-2-8 |year=2010 |edition=3rd |publisher=Sapien Technologies |ref=none}}
  • {{Cite book |last=Jones |first=Don |title=Shell of an Idea: The Untold History of PowerShell|publisher=Self-published|year=2020|isbn=978-1-9536450-3-6 |ref=none}}
  • {{Cite book |last1=Kopczynski |first1=Tyson |last2=Handley |first2=Pete |first3=Marco |last3=Shaw |title=Windows PowerShell Unleashed |isbn=978-0-672-32988-3 |edition=2nd |year=2009 |publisher=Pearson Education |ref=none}}
  • {{Cite book |last1=Kumaravel |first1=Arul |first2=Jon |last2=White |first3=Michael |last3=Naixin Li |first4=Scott |last4=Happell |first5=Guohui |last5=Xie |first6=Krishna C. |last6=Vutukuri |title= Professional Windows PowerShell Programming: Snapins, Cmdlets, Hosts and Providers |isbn= 978-0-470-17393-0 |year=2008 |publisher=Wrox Press |ref=none}}
  • {{Cite book |last=Oakley |first=Andy |title=Monad (AKA PowerShell) |isbn=0-596-10009-4 |year=2005 |publisher=O'Reilly Media |ref=none}}
  • {{Cite book |last=Watt |first=Andrew |year=2007 |title=Professional Windows PowerShell |isbn=978-0-471-94693-9 |publisher=Wrox Press |ref=none}}
  • {{Cite book |last=Wilson |first=Ed |year=2013|title=Windows PowerShell 3.0 Step by Step |isbn=978-0-7356-6339-8 |publisher=Microsoft Press |ref=none}}
  • {{cite book |last=Wilson |first=Ed |year=2014|title=Windows PowerShell Best Practices |publisher=Microsoft Press |isbn=978-0-7356-6649-8 |ref=none}}