Вы можете загрузить файл .ps1 во временную папку Runbook, а затем вызвать его.
Файл test.ps1, хранящийся в хранилище BLOB-объектов, имеет следующий вид:
param([string]$p1,[string]$p2)
Write-Output "***this is from a test ps1 file***"
Write-Output $p1
Write-Output $p2
Код такой:
#create the context to authenticate with azure storage
$context = New-AzureStorageContext -StorageAccountName your_storage_name -StorageAccountKey "your_storage_key"
#download the .ps1 file to runbook temp folder
Get-AzureStorageBlobContent -Container "your_blob_container" -Blob "test.ps1" -Destination $env:temp -Context $context | Out-Null
#execute the powershell
&"$env:temp\test.ps1" -p1 "my name is p1" -p2 "i'm p2"
Результат: