Shutdown / Restart computer with comment

This topic contains 4 replies, has 4 voices, and was last updated by Profile photo of Don Jones Don Jones 2 years, 9 months ago.

  • Author
  • #18695
    Profile photo of Mario

    When I shutdown a server using the GUI (Start -> Shutdown) , there is a comment box that allows you to enter comments.

    I don't see a parameter to specify a comment with the Shutdown-Computer or Restart-Computer cmdlets.

    Does anyone know of an alternative way to specify comments when shutting down / restarting a server via PowerShell

  • #18696
    Profile photo of Greg Altman
    Greg Altman

    The best I could figure out was following this discussion:

    In a nutshell use the native Shutdown command with a /c switch.....

  • #18698
    Profile photo of Mario

    Thanks Greg. This helps.Looks like I'll need to use shutdown.exe for now.

    It would be nice if the PowerShell cmdlets would provide full fidelity with their old command-line counterparts. Oh well – maybe in a future version.


  • #18701
    Profile photo of Jason Hofferle
    Jason Hofferle

    Sounds like a good feature request to add on connect:

  • #18716
    Profile photo of Don Jones
    Don Jones

    Stop- and Restart-Computer aren't technically counterparts to Shutdown.exe. They accomplish a similar task, but through completely different APIs – and it's the underlying APIs, in this case, that don't readily support sending the notification. Jason's correct in that a Connect ticket would be the best way to ask for the functionality. Keep in mind that the PowerShell team doesn't "own" the entire API stack, so sometimes they're limited in what they can provide us.

    Which is also why PowerShell enables you to user external command-line utilities. No reason not to use Shutdown.exe, really, if it's what does the job.

You must be logged in to reply to this topic.