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

Issue when running server with multiple sql instances. #6

Open
DDdgf opened this issue Mar 2, 2018 · 0 comments
Open

Issue when running server with multiple sql instances. #6

DDdgf opened this issue Mar 2, 2018 · 0 comments

Comments

@DDdgf
Copy link

DDdgf commented Mar 2, 2018

# Get a list of all SQL Instances on the current server;
$SQLInstances = Get-SQLInstance -ComputerName $env:COMPUTERNAME

The first instances returned will have it's Instance set to an array of all instances name
and will fail on the first Connect-SQL attempt

Loop through all SQL Instances and extract their DSC information;

foreach($sqlInstance in $SQLInstances)
{        
    $Script:sqlConnectionInfo = Connect-SQL -SQLServer $sqlInstance.sqlserver -SQLInstanceName **$sqlInstance.Instance**

Connect-SQL : Cannot process argument transformation on parameter 'SQLInstanceName'. Cannot convert value to type System.String.
At C:\Temp\SQLServerDSC.Reverse.ps1:86 char:100

  • ... LServer $sqlInstance.sqlserver -SQLInstanceName $sqlInstance.Instance
  •                                                 ~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [Connect-SQL], ParameterBindingArgumentTransformationException
    • FullyQualifiedErrorId : ParameterArgumentTransformationError,Connect-SQL

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