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

SQLAlias throws error on 32 bit alias #949

Closed
ykuijs opened this issue Dec 13, 2017 · 1 comment · Fixed by #950
Closed

SQLAlias throws error on 32 bit alias #949

ykuijs opened this issue Dec 13, 2017 · 1 comment · Fixed by #950
Labels
bug The issue is a bug.

Comments

@ykuijs
Copy link
Member

ykuijs commented Dec 13, 2017

Details of the scenario you tried and the problem that is occurring:
On line 165 of SQLAlias the registry key for the 32 bit alias is created. On a new test environment, the MSSQLServer key (and all child keys) didn't exist yet, resulting in an error when creating the key.

After some troubleshooting I found that New-Item only creates child keys when the parent exists. When the parent does not exist, an error is thrown. This can be resolved by adding the -Force parameter to the cmdlet.

This change is also required for line 152.

The DSC configuration that is using the resource (as detailed as possible):
SQLAlias Alias
{
Ensure = "Present"
Name = "DBServer"
ServerName = "serverx.domain.com"
Protocol = 'TCP'
TcpPort = 1433
}

Version of the Operating System, SQL Server and PowerShell the DSC Target Node is running:
Windows Server 2016

What module (SqlServer or SQLPS) and which version of the module the DSC Target Node is running:
xSQLServer 9.0

Version of the DSC module you're using, or 'dev' if you're using current dev branch:
9.0

@ykuijs ykuijs mentioned this issue Dec 13, 2017
5 tasks
@johlju johlju added bug The issue is a bug. in progress The issue is being actively worked on by someone. labels Dec 17, 2017
johlju pushed a commit that referenced this issue Dec 21, 2017
- Changes to SqlAlias
  - Fixed issue where exception was thrown if reg keys did not exist (issue #949).
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Dec 21, 2017
@mthoger
Copy link

mthoger commented Feb 22, 2018

even on latest build with the -force parameter the error persist.

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

Successfully merging a pull request may close this issue.

3 participants