Supress output from a build file (.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 months and 1 week 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
bvnielsen
Posts: 2
Last visit: Thu Sep 12, 2024 1:10 am

Supress output from a build file (.exe)

Post by bvnielsen »

hi,
i have this code in my script: ($myIP = Get-NetIPAddress -AddressFamily IPv4 | Select-Object IPAddress)
When i build the script and run it (.exe file) i receive this in the console:
consoleMSG.png
consoleMSG.png (9.23 KiB) Viewed 5408 times
I have tried to pipe the result to | out-null without any change. How can i remove the output in the console?
by Alexander Riedel » Thu Mar 28, 2024 9:29 am
That is a progress message. You cannot pipe that to null.
Try this:
$ProgressPreference = 'SilentlyContinue'
Go to full post
User avatar
brittneyr
Site Admin
Posts: 1803
Last visit: Tue Nov 05, 2024 11:31 am
Answers: 44
Been upvoted: 34 times

Re: Supress output from a build file (.exe)

Post by brittneyr »

[Topic was moved by moderator to PowerShell Forum]
Brittney
SAPIEN Technologies, Inc.
User avatar
Alexander Riedel
Posts: 8575
Last visit: Sat Nov 02, 2024 12:15 pm
Answers: 23
Been upvoted: 42 times

Re: Supress output from a build file (.exe)

Post by Alexander Riedel »

That is a progress message. You cannot pipe that to null.
Try this:
$ProgressPreference = 'SilentlyContinue'
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
bvnielsen
Posts: 2
Last visit: Thu Sep 12, 2024 1:10 am

Re: Supress output from a build file (.exe)

Post by bvnielsen »

Thank you . That solution solve the problem and teached me someting new :-)
This topic is 7 months and 1 week 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