Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instance name with a dash is not properly parsed #13

Open
hjkimbrough2 opened this issue Jul 11, 2024 · 0 comments
Open

Instance name with a dash is not properly parsed #13

hjkimbrough2 opened this issue Jul 11, 2024 · 0 comments

Comments

@hjkimbrough2
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant