Unable to Install-Module AzureRM

This topic contains 4 replies, has 2 voices, and was last updated by Profile photo of Will Anderson Will Anderson 1 month, 2 weeks ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #50274
    Profile photo of Manimaran
    Manimaran
    Participant

    Running PowerShell as Administartor

    install-module -Name azurerm -force

    Below is the error message , any ideas why?

    PS C:\WINDOWS\system32> install-module -Name azurerm -force
    PackageManagement\Install-Package : Cannot process argument transformation on parameter 'InstalledModuleInfo'. Cannot
    convert the "System.Object[]" value of type "System.Object[]" to type "System.Management.Automation.PSModuleInfo".
    At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1661 char:21
    + ... $null = PackageManagement\Install-Package @PSBoundParameters
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidData: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Excep
    tion
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Validate-ModuleAuthenticodeSignature,Microsoft.Powe
    rShell.PackageManagement.Cmdlets.InstallPackage

    PS C:\WINDOWS\system32>

    #50293
    Profile photo of Will Anderson
    Will Anderson
    Keymaster

    Hey there Manimaran,

    Are you trying to install the module from a local source? Or from a PSRepository? If you're going from the PowerShell Gallery PSRepository, I would recommend that you install all of the AzureRM modules and not rely on the Import-AzureRm from the AzureRm module. Try this:

    (Find-Module *azurerm*).foreach({Install-Module -Name $PSItem.Name})

    #50297
    Profile photo of Manimaran
    Manimaran
    Participant

    Hey Will, Thanks for the response.
    From PSRepository. I ran the above command below is the error message I get

    [1661,21: Install-Package] Cannot process argument transformation on parameter 'InstalledModuleInfo'. Cannot convert the "
    System.Object[]" value of type "System.Object[]" to type "System.Management.Automation.PSModuleInfo".

    #50311
    Profile photo of Manimaran
    Manimaran
    Participant

    Finally found the fix

    removed the Azure* folders from below locations.

    %ProgramFiles%\WindowsPowerShell\Modules folder
    %ProgramFiles(x86)%\Microsoft SDKs\Azure\PowerShell

    Thanks
    Mani

    #50321
    Profile photo of Will Anderson
    Will Anderson
    Keymaster

    Glad you found the solution! Yeah, the AzureRm modules can get funky from time to time. Also, be sure to watch out when you use update-module against the AzureRm modules as they'll sometimes just install the new version sibe-by-side with your older version and that can cause weirdness with the embedded dependencies in the modules.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.