How to import modules into Azure Automation Account using PowerShell?

Welcome Forums General PowerShell Q&A How to import modules into Azure Automation Account using PowerShell?

Viewing 0 reply threads
  • Author
    Posts
    • #212352
      Participant
      Topics: 10
      Replies: 27
      Points: 188
      Helping Hand
      Rank: Participant

      Hi all,

      I am trying to figure out how to install modules into an Azure automation Account from the PowerShell gallery, and I am struggling…

      New-AzAutomationModule should have been able to do this, but it constabtly gives a status of “Failed” in the list of modules in Azure Automation.
      The command I used is this:
      $AzMods = Find-Module az.*
      ForEach ($AzMod in $AZMods)
      {
      New-AzAutomationModule -AutomationAccountName $AAccName -Name $AzMod.Name -ContentLinkUri "$($AZMod.RepositorySourceLocation)package/$($AzMod.Name)/$($AzMod.Version)" -ResourceGroupName $RGName -Verbose -ErrorAction Continue
      Sleep 5
      }

      I also tried without the version part of the url, but that didn’t change anything.
      Does anyone know how to do this successfully?

      It seems that MS has been kicking PowerShell to the kerb for a while now, but it baffles me that installing modules from the gallery isn’t even listed in the Get-Help section

Viewing 0 reply threads
  • You must be logged in to reply to this topic.