Skip to content
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

Silence progress output of Get-DscResource (take two) #2081

Merged
merged 1 commit into from
Sep 28, 2023

Conversation

andyleejordan
Copy link
Member

It wasn't the module import that was being noisy but the next command. It sure looked like the last commit "fixed" it in testing because the output was certainly silenced...but that was actually due to the side effect of having added an AddScript to the PSCommand causing it to no longer return the imported module at all. Without that return value, the noisy code wasn't executing either. Now the progress preference is saved, set to silent, Get-DscResource is run (silently) and then the preference is restored. Double-checked in the debugger.

@andyleejordan andyleejordan requested a review from a team September 20, 2023 00:59
@andyleejordan
Copy link
Member Author

This is a redo of #2068 which didn't quite work as expected.

It wasn't the module import that was being noisy but the next command.
It sure looked like the last commit "fixed" it in testing because the
output was certainly silenced...but that was actually due to the side
effect of having added an `AddScript` to the `PSCommand` causing it to
no longer return the imported module at all. Without that return value,
the noisy code wasn't executing either. Now the progress preference is
saved, set to silent, `Get-DscResource` is run (silently) and then the
preference is restored. Double-checked in the debugger.
@andyleejordan andyleejordan force-pushed the andyleejordan/actually-fix-dsc-output branch from 7ac9fe7 to 88c7521 Compare September 27, 2023 22:36
Copy link
Collaborator

@SeeminglyScience SeeminglyScience left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@andyleejordan andyleejordan added this pull request to the merge queue Sep 28, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 28, 2023
@andyleejordan andyleejordan added this pull request to the merge queue Sep 28, 2023
Merged via the queue into main with commit ee5194f Sep 28, 2023
@andyleejordan andyleejordan deleted the andyleejordan/actually-fix-dsc-output branch September 28, 2023 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants