azureautomation / runbooks

Sample Automation runbooks
MIT License
150 stars 128 forks source link

Import Azure Modules to Automation #61

Open sowens81 opened 4 years ago

sowens81 commented 4 years ago

Need some help, this may not actually be a script issue.

the Following code errors when run in the script:

$ModuleContentUrl = (Invoke-WebRequest -Uri $ModuleContentUrl -MaximumRedirection 0 -UseBasicParsing -ErrorAction Ignore).Headers.Location

When it run's the parameter is set to the following: $ModuleContentUrl = "https://www.powershellgallery.com/api/v2/package/Az.Automation/1.3.5"

And we get the following error:

Invoke-WebRequest : Object moved Object moved to here.

At line:1 char:22

Any guidance would be great.