Azure Automation: Calling a URL

Oxon

I am new to Azure Automation. I want to call a URL and get its HTML once every weekday morning. This is what I have written so far.

workflow Wakeup-Url
{
    Param 
    (  
        [parameter(Mandatory=$true)]
        [String] 
        $Url
    )

    $day = (Get-Date).DayOfWeek
    if ($day -eq 'Saturday' -or $day -eq 'Sunday'){
        exit
    }

    $output = ""
    InlineScript {"$Using:output = (New-Object System.Net.WebClient).DownloadString(`"$Using:Url`");"}
    write-output $output
}

Its not giving me the HTML in the output when I test the runbook. Instead what I get in the output pane is:

= (New-Object System.Net.WebClient).DownloadString("https://my.url.com/abc.html");

Joe

Your InlineScript is currently just outputting a string containing your script, since you put quotes around the entire expression:

InlineScript {"$Using:output = (New-Object System.Net.WebClient).DownloadString(`"$Using:Url`");"}

This is what you want I think:

$output = InlineScript { (New-Object System.Net.WebClient).DownloadString("$Using:Url"); }

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Azure Automation:URLの呼び出し

分類Dev

Azure Automation Powershell

分類Dev

Azure Devops - Build Automation

分類Dev

Azure Automation Get-AzureRmStorageAccountKey

分類Dev

Azure CosmosDB AutoScaling Using Code/Automation

分類Dev

Does Azure Automation support Write-Information?

分類Dev

Azure Automation moving blobs hashtable error

分類Dev

Calling SpeechAPI for text to speech on Azure

分類Dev

Calling Azure Function from Code

分類Dev

Calling Azure functions through the Azure CLI

分類Dev

C# Selenium Automation Application to be executed in Azure Web Jobs

分類Dev

Azure Automation Power Shell-URLからZipフォルダーをダウンロードして、AzureBLOBに投稿する方法

分類Dev

azure devops repos url

分類Dev

Calling an HTTP URL every 5 minutes and forever

分類Dev

Create adalsql.dll Azure Automation Module (The module was expected to contain an assembly manifest)

分類Dev

Azure Automation RunbookWebhookを呼び出すためのHTMLコード

分類Dev

Azure Automation Powershell Runbook が静かに LoadAssembly に失敗する

分類Dev

Calling Azure Function 150 times by HTTP results in exception

分類Dev

permalink error when calling get_absolute_url

分類Dev

Error while calling spring controller action through URL posting

分類Dev

Azure Automation:資格情報を保存するための最良の方法は?

分類Dev

Azure Automation:「Set-AzureRmAppServicePlan」という用語は認識されません

分類Dev

Karate Automation:jsonデータからURLの動的パスを設定する方法

分類Dev

PowerShell(Azure Automation)を使用してAzure Data Factoryパイプラインをトリガーする方法は?

分類Dev

Azure Automation Run BookからAzureストリーム分析を開始できませんか?

分類Dev

ReferenceError: URL is not defined in Azure javascript function

分類Dev

Azure API 관리-여러 URL?

分類Dev

Azure API管理-複数のURL?

分類Dev

Azure ADD hide default URL and display desired URL with C#

Related 関連記事

  1. 1

    Azure Automation:URLの呼び出し

  2. 2

    Azure Automation Powershell

  3. 3

    Azure Devops - Build Automation

  4. 4

    Azure Automation Get-AzureRmStorageAccountKey

  5. 5

    Azure CosmosDB AutoScaling Using Code/Automation

  6. 6

    Does Azure Automation support Write-Information?

  7. 7

    Azure Automation moving blobs hashtable error

  8. 8

    Calling SpeechAPI for text to speech on Azure

  9. 9

    Calling Azure Function from Code

  10. 10

    Calling Azure functions through the Azure CLI

  11. 11

    C# Selenium Automation Application to be executed in Azure Web Jobs

  12. 12

    Azure Automation Power Shell-URLからZipフォルダーをダウンロードして、AzureBLOBに投稿する方法

  13. 13

    azure devops repos url

  14. 14

    Calling an HTTP URL every 5 minutes and forever

  15. 15

    Create adalsql.dll Azure Automation Module (The module was expected to contain an assembly manifest)

  16. 16

    Azure Automation RunbookWebhookを呼び出すためのHTMLコード

  17. 17

    Azure Automation Powershell Runbook が静かに LoadAssembly に失敗する

  18. 18

    Calling Azure Function 150 times by HTTP results in exception

  19. 19

    permalink error when calling get_absolute_url

  20. 20

    Error while calling spring controller action through URL posting

  21. 21

    Azure Automation:資格情報を保存するための最良の方法は?

  22. 22

    Azure Automation:「Set-AzureRmAppServicePlan」という用語は認識されません

  23. 23

    Karate Automation:jsonデータからURLの動的パスを設定する方法

  24. 24

    PowerShell(Azure Automation)を使用してAzure Data Factoryパイプラインをトリガーする方法は?

  25. 25

    Azure Automation Run BookからAzureストリーム分析を開始できませんか?

  26. 26

    ReferenceError: URL is not defined in Azure javascript function

  27. 27

    Azure API 관리-여러 URL?

  28. 28

    Azure API管理-複数のURL?

  29. 29

    Azure ADD hide default URL and display desired URL with C#

ホットタグ

アーカイブ