Open
Description
Using the constructor, a server name with a dash is properly parsed. In this example, the server name has a dash but the instance name does not:
PS C:\> [DbaInstanceParameter]::new("My-Instance.domain.local\MyTestInstance")
ComputerName : My-Instance.domain.local
InstanceName : MyTestInstance
Port : 0
NetworkProtocol : Any
IsLocalHost : False
FullName : My-Instance.domain.local\MyTestInstance
FullSmoName : My-Instance.domain.local\MyTestInstance
SqlComputerName : [My-Instance.domain.local]
SqlInstanceName : [MyTestInstance]
SqlFullName : [My-Instance.domain.local\MyTestInstance]
IsConnectionString : False
Type : Default
LinkedLive : False
LinkedServer :
InputObject : My-Instance.domain.local\MyTestInstance
In this example, the instance name with a dash is not properly parsed:
PS C:\> [DbaInstanceParameter]::new("My-Instance.domain.local\My-TestInstance")
MethodInvocationException: Exception calling ".ctor" with "1" argument(s): "Failed to parse instance name: My-Instance.domain.local\My-TestInstance. Computer Name: My-Instance.domain.local, Instance My-TestInstance"
I believe dashes are allowed as SQL instance names but are not properly parsed by the library.
Metadata
Assignees
Labels
No labels
Activity