Change logging functions to use Write-Host#12532
Conversation
Change logging helpers to always write to host and either set color or use devops/gh formatting. We do not want to use Write-Error or Write-Warning directly because they can stop the script or not depending on preferences which makes it difficult to ensure local runs of scripts work the same as in the pipelines. So, we should never depend on these logging commands to cause a script to stop execution.
There was a problem hiding this comment.
Pull Request Overview
This PR modifies logging functions to consistently use Write-Host instead of Write-Error and Write-Warning to ensure predictable script execution behavior across different environments. The changes prevent scripts from potentially stopping due to PowerShell preference settings while maintaining visual distinction through color coding.
- Replaced
Write-WarningwithWrite-Hostusing yellow foreground color - Replaced
Write-Errorcalls withWrite-Hostusing red foreground color - Maintained existing DevOps/GitHub Actions formatting for CI/CD environments
Removed legacy error handling for command failures.
|
The following pipelines have been queued for testing: |
|
The following pipelines have been queued for testing: |
|
The following pipelines have been queued for testing: |
Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#12532 See [eng/common workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow) --------- Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com> Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com>
Sync eng/common directory with azure-sdk-tools for PR Azure/azure-sdk-tools#12532 See [eng/common workflow](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/README.md#workflow) --------- Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com> Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com>
Change logging helpers to always write to host and either set color or use devops/gh formatting.
We do not want to use Write-Error or Write-Warning directly because they can stop the script or not depending on preferences which makes it difficult to ensure local runs of scripts work the same as in the pipelines. So, we should never depend on these logging commands to cause a script to stop execution.