Monday, October 17, 2011

PowerShell: Get-Service -Name "MSSQL$SQLEXPRESS"

You can use "get-service" command to get current status of the service.

But, when I execute the following command in PowerShell:

   Get-Service -Name "MSSQL$SQLEXPRESS"

There is an error found below:

  Get-Service : Cannot find any service with service name 'MSSQL'.
  At line:1 char:12
  + Get-Service <<<< -Name "MSSQL$SQLEXPRESS"

The solution is: using "*" instead of "$"

No comments:

Post a Comment