Runbook
Starting A Runbook
Start-AzureRmAutomationRunbook -AutomationAccountName "MyAutomationAccount" -Name "Test-Runbook" -ResourceGroupName "ResourceGroup01"
Graphical Runbook
Introduction To PowerShell
PowerShell is a task-based command-line shell and scripting language built on .NET. PowerShell helps system administrators and power-users can rapidly automate tasks that manage operating systems (Linux, macOS, and Windows) and processes.
Design Goals
PowerShell is designed to improve the command-line and scripting environment by eliminating long-standing problems and adding new features.
- Discoverability
- Consistency
- Interactive and scripting environments
- Object orientation
- Easy transition to scripting
About pages
About pages are help files to give you fundamental PowerShell help. See About
Get-Help about_pipelines
# TOPIC
# about_pipelines
#
#SHORT DESCRIPTION
# Combining commands into pipelines in the Windows PowerShell
Advanced Funcitons
Advanced functions allow you to write functions that can perform operations that are similar to the operations you can perform with cmdlets.
About Functions Advanced (about_functions_advanced)
function Send-Greeting
{
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)]
[string] $Name
)
Process
{
write-host ("Hello " + $Name + "!")
}
}
# Invoke the function
Send-Greeting
Advanced Parameters
you can add parameters to the advanced functions that you write, and use parameter attributes and arguments to limit the parameter values that function users submit with the parameter.
About Functions Advanced Parameters (about_functions_advanced_parameters)
Param(
[parameter(
Mandatory = $true,
ValueFromPipelineByPropertyName = $true,
ParameterSetName = 'Default',
HelpMessage = "Name of Color - e.g. Red"
)]
[ValidateNotNullOrEmpty()]
[ValidateSet("Red", "Blue")]
[Alias("C")]
[String]
$Color
)