0

Possible Duplicate:
Sometimes PowerShell stops sending output until I press enter. Why?

I am executing powershell commands like: powershell.exe "Get-Process java | Stop-Process" and when the command finishes it is requiring me to press Enter before returning me to the console.

Is there a way of executing a command so that I dont have to press enter to be returned to the console?

Steven
  • 101
  • 1
  • 2

1 Answers1

1

Do you get a confirmation message like this one:

Confirm
Are you sure you want to perform this action?
Performing operation "Stop-Process" on Target "java (xxxx)".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): 

Generally, you can suppress confirmations with this:

Get-Process java | Stop-Process -Confirm:$false
Shay Levy
  • 929
  • 1
  • 5
  • 5
  • There is no confirmation dialog, and even a simple script like: powershell.exe -noprofile -NonInteractive -Command "exit 10" will not even exit after running. The console just hangs until I press enter. – Steven Jul 20 '11 at 23:18