PowerShell Version 5 New Feature: NoWait Parameter added to Stop-Service

I presented a session on “What’s New in PowerShell Version 5?” at TechStravaganza in Atlanta this past Friday and there was a lot of information I wasn’t able to get to because of the massive amount of information that I’ve compiled about the updates to PowerShell version 5 that are in the May 2014 preview version so I thought I would blog about them.

He’s a picture of me presenting at TechStravaganza in Atlanta this past Friday. The event was held at the Georgia Tech Research Institute Conference Center:


They must have known I was going to speak on PowerShell as the wording at the bottom of the plaque on the podium says “Problem Solved” as shown in the previous image (click on the image for a larger view).

One of the new features is that Stop-Service now has a NoWait parameter. When you stop a service that doesn’t immediately stop, by default a warning is received stating that in this example: “WARNING: Waiting for service ‘IIS Admin Service (IISAdmin)’ to stop…”:


With this new NoWait parameter, your prompt is returned back to you immediately:


Notice that in the previous example, specifying the PassThru parameter didn’t cause any results to be returned when used with the NoWait parameter. This leads me to believe that these two parameters will end up being in mutually exclusive parameter sets in the final release version.

To give you a better idea of what’s going on under the covers, I’ll stop the service specifying the NoWait parameter and then immediately get the status of the service with the Get-Service cmdlet. I typically wouldn’t use the Format-Table cmdlet in this scenario, but without the AutoSize parameter the value of the Status property is truncated:


This blog article has been written based on the preview version of PowerShell version 5 from the May 2014 release of the Windows Management Framework 5.0 preview so what you’ve seen here is subject to change in the final release version.

This blog article is one of many that I’ve written and will be writing about the new features in PowerShell version 5. You can find my other blog articles on PowerShell version 5 here.



  1. Paul Ciolak

    This feature is not working on Windows 2008 server, powershell version 5.1


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: