Skip to content

Suggestion to improve $*Preference defaults #12

@felixfbecker

Description

@felixfbecker

One thing I found myself always prepending to all my GitHub action PowerShell script is setting $ProgressPreference and $InformationPreference.

  • $ProgressPreference to 'Silent', because on the GitHub action log PowerShell cannot draw an interactive progress bar and it otherwise causes mangled output
  • $InformationPreference to 'SilentlyContinue' (instead of default 'Silent') because in GitHub actions you usually want to be able to log text with Write-Information (and the pipeline output is used as the action output). And can be a bit of a debugging pitfall to realize that Write-Information is 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions