Suppressing undesired output that appears in generated EXE

Ask your PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 7 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Suppressing undesired output that appears in generated EXE

Post by Alexander Riedel »

Ran a packaged exe with invoke-webrequest in a debugger and looked where the output comes from.
Alexander Riedel
SAPIEN Technologies, Inc.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Suppressing undesired output that appears in generated EXE

Post by jvierra »

I tried to do that but couldn't get the VS debugger to break in the script and didn't push further. I assumed you would do better with the source and PDB to work with. You did it pretty fast but then I guess you have been looking at this in the debugger for a long time.
User avatar
andycarpenter@westat.com
Posts: 18
Last visit: Wed Jan 17, 2024 9:56 am

Re: Suppressing undesired output that appears in generated EXE

Post by andycarpenter@westat.com »

I just did a quick test and this looks to suppress the output -- for Get-NetConnectionProfile also.

I REALLY appreciate the assistance each of you provided in resolving this. Ultimately, it was a PowerShell coding issue, but took a lot of work by folks far more knowledgeable than me to see that.

Thank you again.
Andy
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Suppressing undesired output that appears in generated EXE

Post by jvierra »

Glad to help. It baffled me but Alex with his trusty debugger saw it right away. It is not something that most of us would have guessed since no progress came up ever when testing as a script.
This topic is 7 years and 9 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked