2

I have a script which does some settings in registry. As a consequence I have to kill one process.

Stop-Process -processname explorer -force | Out-Null 

Now I would like to get rid of this message:

Der Vorgang wurde erfolgreich beendet. 

(I guess english version must be something like: The process was completed successfully) Do you have any idea how to stop all output of Stop-Process?

#Update You are very right I should have tried just that command alone to see it is not the right command to look at. I structured my console output better to find out what command is causing me that trouble and found out these two:

reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d C:\folder\wallpaper.png /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /v HiberbootEnabled /t reg_dword /d 0 /f 

Append these two with | Out-Null works just as expected. :)

I guess I was confused by the message "The process was completed successfully" because I would not expect it after editing registry. In my script I use also other methods to change registry and they do not produce that output. For example:

Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\Explorer" -Name "DisableNotificationCenter" -Type DWord -Value 1 

And since I had this message appear two times and I was killing two processes in my script I was wrong assuming that Stop-Process is at fault. Yet another example how easy it is to draw wrong correlations. Thanks for Help. I can't grasp how could I miss it.

2
  • I'm unable to reproduce the behavior described, what version of PowerShell are you using (see $PSVersionTable.PSVersion), and which version of Windows? Commented Sep 7, 2020 at 14:31
  • I also cant reproduce it...usually there is no output on this command...I tried stop-Process -name iexplore and just closed IExplorer...-force or |Out-Null was not necessary Commented Sep 7, 2020 at 14:33

1 Answer 1

1

Are you sure that you are trying to suppress the right thing? This is a typical message of reg command, which is probably used in your script considering it does some settings in the registry. Out-Null that instead of Stop-Process.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.