microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.44k stars 2.6k forks source link

Azure PowerShell fails on self hosted x86 agents #9146

Closed bogdancucosel closed 4 years ago

bogdancucosel commented 5 years ago

The failure is: Cannot find path 'HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall' because it does not exist.

It happens on x86 agents, we tried Windows 8.1 and Windows 10

Environment

Issue Description

Failing task Azure PowerShell, version 3.1.10

Task logs

windows_10_logs.zip

arjgupta commented 5 years ago

Thanks for reporting this issue. We will work on fixing this.

20shivangi commented 5 years ago

@bogdancucosel Which Azure PowerShell version (x86 or x64) have you used ? Please refer to this link to get x86 version of Azure PowerShell msi : https://github.com/Azure/azure-powershell/releases/tag/v6.13.1-November2018

bogdancucosel commented 5 years ago

@20shivangi e have different versions. We tried with 5.7.0 right now, and with the new version of the task , we get :

[section]Starting: Azure PowerShell script: InlineScript

============================================================================== Task : Azure PowerShell Description : Run a PowerShell script within an Azure environment Version : 3.1.24 Author : Microsoft Corporation Help : More Information

Added TLS 1.2 in session. The list of available Azure modules:

Name Version


Azure 5.1.2

The list of available AzureRM modules:

Name Version


AzureRM 5.7.0

[command]Disconnect-AzureRmAccount -Scope Process -ErrorAction Stop

[warning]Run Connect-AzureRmAccount to login.

[error]Could not find the modules: 'AzureRM' with Version: '5.1.2'. If the module was recently installed, retry after restarting the Azure Pipelines task agent.

[section]Finishing: Azure PowerShell script: InlineScript

20shivangi commented 5 years ago

@bogdancucosel If the machine is 64 bit, then x-64 version of Azure RM module must be installed . If you install x86 version of Azure RM module the error saying "Could not find the modules: AzureRM with Version: 5.1.2. If the module was recently installed, retry after restarting the Azure Pipelines task agent." is given .

bogdancucosel commented 5 years ago

No, the machine is a 32 bit machine.

Agent.OSArchitecture X86
20shivangi commented 5 years ago

@bogdancucosel And what is Azure RM module version , it is x86 ?

bogdancucosel commented 5 years ago

@20shivangi I do not understand. Yes it is, I can install Azure Rm x64 version on a x86 OS ?

arjgupta commented 5 years ago

Hey @bogdancucosel There is an input in the task that let's you specify the version of Azure PowerShell that should be imported by the task. Can you specify the version of azure powershell that you have installed on your machine in this input and then try running the task ? The version should be a proper semantic version .. i.e. 5.7.0 or 6.13.1 etc.

bogdancucosel commented 5 years ago

@arjgupta the version was 5.7.0

arjgupta commented 5 years ago

Did you specify the version in the Input and then try to run the task ? I believe that should work correctly. Can you try this and let me know.

20shivangi commented 5 years ago

@bogdancucosel Is there any update ?

chshrikh commented 4 years ago

please let us know if there is any issues