PowerShell Workflow Runbooks

4 MIN READ

PowerShell Workflow runbooks are text runbooks based on Windows PowerShell Workflow. You directly edit the code of the runbook using the text editor in the Azure portal. You can also use any offline text editor and import the runbook into Azure Automation.

powershell workflows runbooks

Advantages

Limitations

Prerequisites

modules imported into the Automation account
Add role assignment (Preview) page
Using Ad for app registration
Create a runbook

Add code to the runbook

You can either type code directly into the runbook, or you can select cmdlets, runbooks, and assets from the library control and add them to the runbook.

For example, we will try to connect SharePoint Online using App Registration.

add code to the runbook
Test page displays its output

Publish and start the runbook

Publish and start the runbook

How to get file from SharePoint directory or any cloud storage

get file from SharePoint directory or any cloud storage
Search for the module to add

Methods to connect Automation account with resources:

Methods to connect Automation account with resources
Select add permission

Create new runbook

Start by creating a simple PowerShell Workflow runbook. One advantage of Windows PowerShell Workflows is the ability to perform a set of commands in parallel instead of sequentially as with a typical script.

Create new runbook
Test the Runbook
 edit powershell runbook get automation connection

Test the Runbook

test the runbook
store output in runbook directory