-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Resolution-FixedThe issue is fixed.The issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issues
Description
Filed on UserVoice: http://windowsserver.uservoice.com/forums/301869/suggestions/17193962
The error message for Get-Service returns a NoServiceFoundForGivenName exception even when the problem is an invalid -ComputerName, potentially misleading the user.
Steps to reproduce
Get-Service wuauserv -ComputerName MadeUpComputerNameExpected behavior
Get-Service : Cannot find any computer with name 'MadeUpComputerName'.
At line:1 char:1
+ Get-Service wuauserv -ComputerName MadeUpComputerName
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (wuauserv:String) [Get-Service], ServiceCommandExce
ption
+ FullyQualifiedErrorId : SomeOtherExceptionForComputerNameNotFound,Microsoft.PowerShell.Commands.GetService
Command
Actual behavior
Get-Service : Cannot find any service with service name 'wuauserv'.
At line:1 char:1
+ Get-Service wuauserv -ComputerName MadeUpComputerName
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (wuauserv:String) [Get-Service], ServiceCommandExce
ption
+ FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.GetService
Command
Environment data
> $PSVersionTable
Name Value
---- -----
PSRemotingProtocolVersion 2.3
PSVersion 6.0.0-alpha
WSManStackVersion 3.0
BuildVersion 3.0.0.0
SerializationVersion 1.1.0.1
PSEdition Core
GitCommitId v6.0.0-alpha.12
CLRVersion
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}Metadata
Metadata
Assignees
Labels
Resolution-FixedThe issue is fixed.The issue is fixed.Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issues