Skip to content

Remove Write-Host from PRTest.ps1 #240696

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

Merged
merged 3 commits into from
Mar 19, 2025
Merged

Conversation

Trenly
Copy link
Contributor

@Trenly Trenly commented Mar 17, 2025

Checklist for Pull Requests

According to ScriptAnalyzer, Write-Host should be avoided because it may not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, ore redirected.

This PR updates PRTest.ps1 with the following changes -

  • Replaces Write-Host with Write-Error for error messages
  • Replaces Write-Host with Write-Information elsewhere
  • Adds debug and verbose messages
  • Adds VirtualTerminal support for retaining coloring used by Write-Host
  • Gets full diff of manifests instead of just the latest commit
  • Uses explicit casting rather than checking the variable type returned by the diff

cc @denelon / @mdanish-kh

Microsoft Reviewers: Open in CodeFlow

@Trenly Trenly requested review from denelon and a team as code owners March 17, 2025 17:08
@wingetbot
Copy link
Collaborator

Service Badge  Service Badge  

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Attention This work item needs to be reviewed by a member of the core team. label Mar 17, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Attention This work item needs to be reviewed by a member of the core team. label Mar 17, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added the Moderator-Approved One of the Moderators has reviewed and approved this PR label Mar 18, 2025
@Trenly Trenly requested a review from mdanish-kh March 18, 2025 22:54
@microsoft-github-policy-service microsoft-github-policy-service bot removed the Moderator-Approved One of the Moderators has reviewed and approved this PR label Mar 18, 2025
@mdanish-kh
Copy link
Contributor

@denelon - This looks good to go

@microsoft-github-policy-service microsoft-github-policy-service bot added the Moderator-Approved One of the Moderators has reviewed and approved this PR label Mar 19, 2025
@denelon denelon merged commit 9e6ac1d into microsoft:master Mar 19, 2025
2 checks passed
@Trenly Trenly deleted the PrTestUpdate branch March 27, 2025 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Moderator-Approved One of the Moderators has reviewed and approved this PR Project-File
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants