pwsh-script
pwsh-script copied to clipboard
Suggestion to improve $*Preference defaults
trafficstars
One thing I found myself always prepending to all my GitHub action PowerShell script is setting $ProgressPreference and $InformationPreference.
$ProgressPreferenceto'Silent', because on the GitHub action log PowerShell cannot draw an interactive progress bar and it otherwise causes mangled output$InformationPreferenceto'SilentlyContinue'(instead of default'Silent') because in GitHub actions you usually want to be able to log text withWrite-Information(and the pipeline output is used as the action output). And can be a bit of a debugging pitfall to realize thatWrite-Informationis swallowed).
What do you think about adding these two lines to the action itself so they don't have to be added manually? I think it would improve the developer experience and not be harmful (and worse case it can be overridden by the user)
Happy to do a PR.