azureautomation / runbooks

Sample Automation runbooks
MIT License
154 stars 129 forks source link

BUG: New-OnPremiseHybridWorker assumes PSGallery as source #54

Open peppekerstens opened 5 years ago

peppekerstens commented 5 years ago

Cause When script is run, it assumes PSGallery as (single) source for AzureRm. The script fails when there are more sources for the defined module, because it finds multiple versions.

C:\Program Files\WindowsPowerShell\scripts\New-OnPremiseHybridWorker.ps1 : Cannot process argument transformation on parameter
'RequiredVersion'. Cannot convert value to type System.String.
At line:1 char:1
+ .\New-OnPremiseHybridWorker.ps1 -AutomationAccountName Billing -AARes ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [New-OnPremiseHybridWorker.ps1], ParameterBindingArgumentTransformationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,New-OnPremiseHybridWorker.ps1

Solution Add the source in the code