AnatomyOf

Anatomy of a PowerShell file

example.ps1
1<#
2.SYNOPSIS
3 A minimal PowerShell script.
4.NOTES
5 Verb-Noun or it never happened.
6#>
7
8$Greeting = "Hello"
9
10function Get-Greeting {
11 param(
12 [string]$Name = "World"
13 )
14 return "$Greeting, $Name!"
15}
16
17if ($Greeting -eq "Hello") {
18 Write-Host (Get-Greeting -Name "PowerShell")
19}
PowerShell is a cross-platform task automation and configuration management framework, consisting of a command-line shell and scripting language.