Skip to content

[BUG]: VstsAzureHelpers_ --> InitializeAzModuleFunctions.ps1 outputs object type and not content when using write-host #19696

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
5 of 7 tasks
mortenlerudjordet opened this issue Mar 27, 2024 · 2 comments

Comments

@mortenlerudjordet
Copy link
Contributor

mortenlerudjordet commented Mar 27, 2024

New issue checklist

Task name

common/VstsAzureHelpers_

Task version

latest

Issue Description

In InitializeAzModuleFunctions.ps1 following code needs to be changed.

From:
Write-Host "##[command]$command $args"
To:
Write-Host "##[command]$command $($args | Out-String)"

$args is a hashtable and using it inside quotation marks on write-host will only output object type to terminal and not the contents of it. By piping to out-string will change this behavior.

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

All

Relevant log output

From AzurePowershellV5 output using the helper function:


Connect-AzAccount System.Collections.Hashtable

Tasks

Preview Give feedback
No tasks being tracked yet.
@mortenlerudjordet mortenlerudjordet changed the title [BUG]: InitializeAzModuleFunctions.ps1 outputs object type and not content when using write-host [BUG]: VstsAzureHelpers_ --> InitializeAzModuleFunctions.ps1 outputs object type and not content when using write-host Mar 27, 2024
@mortenlerudjordet
Copy link
Contributor Author

Added change in PR: #19712

@mortenlerudjordet
Copy link
Contributor Author

Merged with PR: #19762

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant