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
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.
Solution Add the source in the code