Skip to content

Instance name with a dash is not properly parsed #13

Open
@hjkimbrough2

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions