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

SqlScript: When this resource is used directly after an SQL Server install it fails #659

Closed
johlju opened this issue Jun 24, 2017 · 1 comment
Assignees
Labels
bug The issue is a bug.

Comments

@johlju
Copy link
Member

johlju commented Jun 24, 2017

Details of the scenario you tried and the problem that is occurring:
When this resource is used directly after an SQL Server install it fails.
This is because the PowerShell session has not yet updated the environment variable PSModulePath to include the new path to SQLPS module. Unless target node was restarted after SQL Server installation.

The DSC configuration that is using the resource (as detailed as possible):
Any configuration using xSQLServerScript resource, and target node is not restarted after SQL Server installation.

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

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

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

@johlju johlju added bug The issue is a bug. in progress The issue is being actively worked on by someone. labels Jun 24, 2017
johlju added a commit to johlju/SqlServerDsc that referenced this issue Jun 24, 2017
Now it correctly loads the correct assemblies when SqlServer module is present (issue dsccommunity#649).
Now SQLPS module will be correctly loaded (discovered) after installation of SQL Server (issue dsccommunity#659). Previously resources depending on SQLPS module could fail because SQLPS was not found after installation because the PSModulePath environment variable in the (LCM) PowerShell session did not contain the new module path.
@johlju johlju self-assigned this Jun 24, 2017
johlju added a commit to johlju/SqlServerDsc that referenced this issue Jul 8, 2017
Now it correctly loads the correct assemblies when SqlServer module is present (issue dsccommunity#649).
Now SQLPS module will be correctly loaded (discovered) after installation of SQL Server (issue dsccommunity#659). Previously resources depending on SQLPS module could fail because SQLPS was not found after installation because the PSModulePath environment variable in the (LCM) PowerShell session did not contain the new module path.
johlju added a commit to johlju/SqlServerDsc that referenced this issue Jul 12, 2017
Now it correctly loads the correct assemblies when SqlServer module is present (issue dsccommunity#649).
Now SQLPS module will be correctly loaded (discovered) after installation of SQL Server (issue dsccommunity#659). Previously resources depending on SQLPS module could fail because SQLPS was not found after installation because the PSModulePath environment variable in the (LCM) PowerShell session did not contain the new module path.
johlju added a commit to johlju/SqlServerDsc that referenced this issue Jul 13, 2017
Now it correctly loads the correct assemblies when SqlServer module is present (issue dsccommunity#649).
Now SQLPS module will be correctly loaded (discovered) after installation of SQL Server (issue dsccommunity#659). Previously resources depending on SQLPS module could fail because SQLPS was not found after installation because the PSModulePath environment variable in the (LCM) PowerShell session did not contain the new module path.
johlju added a commit to johlju/SqlServerDsc that referenced this issue Aug 13, 2017
Now it correctly loads the correct assemblies when SqlServer module is present (issue dsccommunity#649).
Now SQLPS module will be correctly loaded (discovered) after installation of SQL Server (issue dsccommunity#659). Previously resources depending on SQLPS module could fail because SQLPS was not found after installation because the PSModulePath environment variable in the (LCM) PowerShell session did not contain the new module path.
johlju added a commit to johlju/SqlServerDsc that referenced this issue Aug 17, 2017
Now it correctly loads the correct assemblies when SqlServer module is present (issue dsccommunity#649).
Now SQLPS module will be correctly loaded (discovered) after installation of SQL Server (issue dsccommunity#659). Previously resources depending on SQLPS module could fail because SQLPS was not found after installation because the PSModulePath environment variable in the (LCM) PowerShell session did not contain the new module path.
johlju added a commit to johlju/SqlServerDsc that referenced this issue Aug 19, 2017
Now it correctly loads the correct assemblies when SqlServer module is present (issue dsccommunity#649).
Now SQLPS module will be correctly loaded (discovered) after installation of SQL Server (issue dsccommunity#659). Previously resources depending on SQLPS module could fail because SQLPS was not found after installation because the PSModulePath environment variable in the (LCM) PowerShell session did not contain the new module path.
johlju added a commit to johlju/SqlServerDsc that referenced this issue Aug 19, 2017
Now it correctly loads the correct assemblies when SqlServer module is present (issue dsccommunity#649).
Now SQLPS module will be correctly loaded (discovered) after installation of SQL Server (issue dsccommunity#659). Previously resources depending on SQLPS module could fail because SQLPS was not found after installation because the PSModulePath environment variable in the (LCM) PowerShell session did not contain the new module path.
johlju added a commit to johlju/SqlServerDsc that referenced this issue Sep 8, 2017
Now it correctly loads the correct assemblies when SqlServer module is present (issue dsccommunity#649).
Now SQLPS module will be correctly loaded (discovered) after installation of SQL Server (issue dsccommunity#659). Previously resources depending on SQLPS module could fail because SQLPS was not found after installation because the PSModulePath environment variable in the (LCM) PowerShell session did not contain the new module path.
@johlju johlju changed the title xSQLServerScript: When this resource is used directly after an SQL Server install it fails SqlScript: When this resource is used directly after an SQL Server install it fails Dec 24, 2017
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Jan 5, 2018
@johlju
Copy link
Member Author

johlju commented Jan 5, 2018

I do believe this issue is resolved since a while back.

https://github.com/PowerShell/SqlServerDsc/blob/cb085f0667c07226576f4d55ea3bd38341c965a1/SqlServerDscHelper.psm1#L706-L712

Closing this issue.

@johlju johlju closed this as completed Jan 5, 2018
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

No branches or pull requests

1 participant