Open ArunasFalcon opened 1 year ago
Workaround: Switching to task version 4.*
I experienced the same issue. As @ArunasFalcon mentioned, setting to AzurePowerShell@4 resolved the issue. We are using self-hosted agents. Current agent version: '2.175.2'
UPDATE: Experiencing the same problem after agent update. Current agent version: '3.220.2'
We're also receiving this error on multiple VMSS self-hosted build agents and using the workaround switching from AzurePowerShell@5 to AzurePowerShell@4 has got us back up and running.
##[debug]Error record:
##[debug]
##[debug]Import-Module: C:\a\_tasks\AzurePowerShell_72a1931b-effb-4d2e-8fd8-f8472a07cb62\5.221.102\ps_modules\VstsAzureHelpers_\InitializeAzModuleFunctions.ps1:65
##[debug]Line |
##[debug] 65 | … $module = Import-Module -Name $module.Path -Global -PassThru -Force …
##[debug] | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##[debug] | Assembly with same name is already loaded
##[debug]
##[debug]Script stack trace:
##[debug]at Import-AzModule, C:\a\_tasks\AzurePowerShell_72a1931b-effb-4d2e-8fd8-f8472a07cb62\5.221.102\ps_modules\VstsAzureHelpers_\InitializeAzModuleFunctions.ps1: line 65
##[debug]at Initialize-AzModule, C:\a\_tasks\AzurePowerShell_72a1931b-effb-4d2e-8fd8-f8472a07cb62\5.221.102\ps_modules\VstsAzureHelpers_\InitializeAzModuleFunctions.ps1: line 24
##[debug]at <ScriptBlock>, C:\a\_tasks\AzurePowerShell_72a1931b-effb-4d2e-8fd8-f8472a07cb62\5.221.102\CoreAz.ps1: line 27
##[debug]at <ScriptBlock>, C:\a\_temp\a4626e70-1b4a-4d8f-bad2-2652afcbf8d9.ps1: line 3
##[debug]at <ScriptBlock>, <No file>: line 1
##[debug]Exception:
##[debug]System.IO.FileLoadException: Assembly with same name is already loaded
##[debug] at System.Management.Automation.Runspaces.InitialSessionState.Bind_LoadAssemblies(ExecutionContext context)
##[debug] at System.Management.Automation.Runspaces.InitialSessionState.Bind(ExecutionContext context, Boolean updateOnly, PSModuleInfo module, Boolean noClobber, Boolean local, Boolean setLocation)
##[debug] at Microsoft.PowerShell.Commands.ModuleCmdletBase.LoadModuleManifest(String moduleManifestPath, ExternalScriptInfo manifestScriptInfo, Hashtable data, Hashtable localizedData, ManifestProcessingFlags manifestProcessingFlags, Version minimumVersion, Version maximumVersion, Version requiredVersion, Nullable`1 requiredModuleGuid, ImportModuleOptions& options, Boolean& containedErrors)
##[error]Assembly with same name is already loaded
##[debug]Processed: ##vso[task.logissue type=error]Assembly with same name is already loaded
##[debug]Exit code: 1
##[debug]Leaving Invoke-VstsTool.
##[error]PowerShell exited with code '1'.
Also viewing this issue with AzureCLI task version 2.*. Switching to AzurePowerShell task, either version 4 or 5, did not resolve the issue. Self-hosted agent version is 3.220.5. All logic runs fine locally. Switching to a hosted agent works, however.
This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days
This is still an issue with task version 5.*.
This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days
This is still an issue with task version 5.*.
Task name
Azure PowerShell
Task version
5.221.102
Environment type (Please select at least one enviroment where you face this issue)
Azure DevOps Server type
dev.azure.com (formerly visualstudio.com)
Azure DevOps Server Version (if applicable)
No response
Operation system
Windows
Task log
Relevant log output
Aditional info