I am trying to create an Azure Automation job to create a new Azure Automation Runbook. I am using the following to try to get it to work.
$Context = New-AzureStorageContext $storageAccountName $storageAccountKey
$Path = Get-AzureStorageFile -ShareName "qdrive" -Path "TestWorkFlow.ps1" -Context $Context |Select-object Name |Out-String
Import-AzureRMAutomationRunbook -ResourceGroupName $ResourceGroupName -AutomationAccountName $AutomationAccountName -Path $Path -Type PowerShellWorkflow -Force -Name $Name -Published
I get an error message of Import-AzureRMAutomationRunbook:Cannot find path 'C:\Windows\System32\ Name ------ TestWorkFlow.ps1
I need help figuring out how to send the path of the file to the $path variable in a UNC and not a URI.
Thanks!