Running a runbook on hybrid worker

In this scenario, we will execute a fairly simple runbook on a hybrid worker. The runbook will look for all files in a directory specified in a runbook source parameter and copy to another hybrid worker directory specified in a runbook target parameter:

workflow File-Copy{     Param    (        [parameter(Mandatory=$true)]        [String] $FileSource,        [parameter(Mandatory=$true)]        [String] $FileDestination    )    Write-Output "Runbook is executing on On-premises Hybrid worker: $env:ComputerName"    Write-Output "File Destination: $FileDestination"    Write-Output "Source of File: $FileSource"     $execute = InlineScript    {        Try        {            Copy-Item -Path "$using:FileSource" -Destination "$using:FileDestination" -recurse        }        catch        { $errorMessage = $error[0].Exception.Message ...

Get Microsoft Operations Management Suite Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.