Skip to content

The Powershell install script does not restore the Set-PSDebug -Trace value #2317

@Lenormju

Description

@Lenormju

Context

Hello, I just installed lastest binstall (version 1.15.5) using the recommended way on Windows, that is to run the PowerShell script from the main branch (current version is git revision 266e627).
But after that, I noticed strange outputs in my powershell session : I had traces enabled, so that each line I ran caused debug output to be produced, and many lines when invoking commands or scripts.
Turns out, it comes from the Set-PSDebug variables.

Problem

The install script starts with Set-PSDebug -Trace 1, which enables tracing, but never reverts it to 0 (the default) or to its initial value.

Solution

So I suggest, to avoid this strange behavior, to add Set-PSDebug -Trace 0 at the end of script.
It seems difficult (impossible ?) to know what is the current value at the start of the script (cf this StackOverflow question and the lack of a Set-PSDebug cmdlet).

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