PLDB
Languages Features Calendar About Lists Add Language
GitHub icon

PowerShell

PowerShell

PowerShell is a programming language created in 2006 by Jeffrey Snover.

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

Try now: Riju ยท TIO

#43on PLDB 16Years Old 208.7kUsers

Example code from Riju:

Write-Host "Hello, world!"

Example code from hello-world:

'Hello World'

Example code from the Hello World Collection:

# Hello World in Microsoft Powershell 'Hello World!'

Example code 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 code from Wikipedia:

name value1 value2 name -Param1 value1 -Param2 value2

Keywords in PowerShell

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 Example Token
Conditionals โœ“
Switch Statements โœ“
Functions โœ“
Exceptions โœ“
Classes โœ“
While Loops โœ“
MultiLine Comments โœ“
<# A comment
#>
<# #>
Strings โœ“ '
Assignment โœ“ =
Print() Debugging โœ“ echo
Line Comments โœ“
# A comment
#
Comments โœ“
Semantic Indentation ฯด

Trending PowerShell repos on GitHub

repo stars description
azure-quickstart-templates 5646 Azure Quickstart Templates
commando-vm 2883 "Complete Mandiant Offensive VM (Commando VM) a fully customizable Windows-based pentesting virtual machine distribution."
docs 1949 This repository contains .NET Documentation.
azure-docs 3023 Open source documentation of Microsoft Azure
azure-pipelines-image-generation 527 Azure Pipelines VM image generation for Microsoft-hosted CI/CD
atomic-red-team 2427 Small and highly portable detection tests based on MITRE's ATT&CK.
sp-dev-docs 803 SharePoint Developer Documentation
PowerSploit 5774 PowerSploit - A PowerShell Post-Exploitation Framework
Blazor 8382 Blazor is a .NET web framework using C#/Razor and HTML that runs in the browser with WebAssembly
Win10-Initial-Setup-Script 2542 PowerShell script for automation of routine tasks done after fresh installations of Windows 10 / Server 2016 / Server 2019
BloodHound 3358 Six Degrees of Domain Admin
Windows10Debloater 2759 Script to remove Windows 10 bloatware.
flare-vm 1575
machinelearning-samples 1966 "Samples for ML.NET an open source and cross-platform machine learning framework for .NET."
posh-git 3788 A PowerShell environment for Git
ImportExcel 1083 "PowerShell module to import/export Excel spreadsheets without Excel"
bashbunny-payloads 1176 The Official Bash Bunny Payload Repository
nishang 3127 "Nishang - Offensive PowerShell for red team penetration testing and offensive security."
dynamics-365-unified-operations-public 91 "Documentation for Microsoft Dynamics 365 for Finance and Operations Dynamics 365 for Retail and Dynamics 365 for Talent"
scoop-extras 580 """Extras"" bucket for Scoop"
OfficeDocs-Exchange 47 Contains documentation for Exchange Server and Exchange Online
windows-driver-docs 239 The official Windows Driver Kit documentation sources
appcenter-docs 51 content repo for Visual Studio App Center on docs.microsoft.com

Books about PowerShell on goodreads

title author year reviews ratings rating
Windows PowerShell for Developers Douglas Finke 2012 7 64 3.70
Powershell: Comprehensive Beginner's Guide to Learn Powershell Programming Daniel Jones 0 2 1.00
Windows PowerShell 2 for Dummies Steve Seguis 2009 1 18 3.94

Article source

PLDB - Build the next great programming language. v5.0.0 - Acknowledgements ยท Email ยท GitHub