Top 1,000 Features Creators Events Podcasts Extensions Blog Explorer CSV Download

PowerShell

< >

PowerShell is an open source programming language created in 2006 by Jeffrey Snover.

#19on PLDB 18Years Old 161kRepos
Download source code:
git clone https://github.com/PowerShell/PowerShell

Try now: Riju ยท TIO

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


Example from Riju:
Write-Host "Hello, world!"
Example from hello-world:
'Hello World'
# Hello World in Microsoft Powershell 'Hello World!'
Example from Linguist:
#!/usr/bin/env pwsh # source: https://github.com/PowerShell/PowerShellStandard/blob/3436bfc162d6804dd11d1d76c4faff486b4b405d/build.ps1 param ( [Parameter(ParameterSetName="Clean")][switch]$Clean, [Parameter(ParameterSetName="Test")][switch]$Test ) import-module $PSScriptRoot/PowerShellStandard.psm1 -force if ( $Clean ) { Start-Clean return } Start-Build if ( $Test ) { Invoke-Test }
Example from Wikipedia:
name value1 value2 name -Param1 value1 -Param2 value2
PowerShell Keywords
begin break catch class continue data define do dynamicparam else elseif end exit filter finally for foreach from function if in param process return switch throw trap try until using var while workflow parallel sequence inlinescript configuration

Language features

Feature Supported Token Example
Conditionals โœ“
Switch Statements โœ“
Functions โœ“
Exceptions โœ“
Classes โœ“
While Loops โœ“
MultiLine Comments โœ“ <# #>
<# A comment
#>
Strings โœ“ '
Assignment โœ“ =
Print() Debugging โœ“ echo
Line Comments โœ“ #
# A comment
Comments โœ“
Semantic Indentation X

View source

- Build the next great programming language ยท About ยท Resources ยท Acknowledgements ยท Part of the World Wide Scroll