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

SqlPermission: Undefined DSC resource 'SqlPermission' #1954

Open
ghost opened this issue Aug 4, 2023 · 9 comments
Open

SqlPermission: Undefined DSC resource 'SqlPermission' #1954

ghost opened this issue Aug 4, 2023 · 9 comments
Labels
waiting for author response The pull request is waiting for the author to respond to comments in the pull request.

Comments

@ghost
Copy link

ghost commented Aug 4, 2023

Problem description

The SQLPermission resource cannot be loaded. I use VSCODE version 1.81.0 and SsqlServerDSC 16.3.1 ( 16.4.0 preview does not work either )

Verbose logs

N/A

How to reproduce

Load the example of SQLPermission page in vscode or just type the resource manually and SQLPermission is completely missing in the suggestions.

Expected behavior

Load SQLPermission

Current behavior

VSCODE Error: Undefined DSC resource 'SqlPermission'. Use Import-DSCResource to import the resource.

Suggested solution

N/A

Operating system the target node is running

OsName               : Microsoft Windows 10 Pro
OsOperatingSystemSKU : 48
OsArchitecture       : 64-bit
WindowsVersion       : 2009
WindowsBuildLabEx    : 19041.1.amd64fre.vb_release.191206-1406
OsLanguage           : en-US
OsMuiLanguages       : {en-US}

PowerShell version and build the target node is running

PSVersion                      7.3.6
PSEdition                      Core
GitCommitId                    7.3.6
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0


---- SAME BEHAVIOR ----

PSVersion                      5.1.19041.3031
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.3031
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Module version used

Name         Version Path
----         ------- ----
SqlServerDsc 16.3.1  C:\Program Files\WindowsPowerShell\Modules\SqlServerDsc\16.3.1\SqlServerDsc.psd1
@johlju johlju added the needs investigation The issue needs to be investigated by the maintainers or/and the community. label Aug 9, 2023
@johlju
Copy link
Member

johlju commented Aug 21, 2023

I cannot reproduce this.

Note

PS 7.x won't work since it does not support DSC resources in the way that Windows PowerShell does. See the work being done for DSCv3.

On a clean Windows machine I installed VS Code + PowerShell extension. Using Windows PowerShell I installed SqlServerDsc to machine PSModulePath (C:\Program Files\WindowsPowerShell\Modules). In VS Code the PowerShell extension is also running under Windows PowerShell. I pasted in an example from the wiki page and in ran as expected. Also SqlPermission is visible in intellisense when editing the example.

@johlju johlju added waiting for author response The pull request is waiting for the author to respond to comments in the pull request. and removed needs investigation The issue needs to be investigated by the maintainers or/and the community. labels Aug 21, 2023
@johlju johlju changed the title SQLPermission // Undefined DSC resource 'SqlPermission' SqlPermission: Undefined DSC resource 'SqlPermission' Aug 21, 2023
@ghost
Copy link
Author

ghost commented Aug 22, 2023

Hi,

I am on vacation and will be able to reply again no later than October. But until then, maybe you can tell what I can provide for more information. Greetings

@johlju
Copy link
Member

johlju commented Aug 22, 2023

Since it was not possible to reproduce . Clear step-by-steps that shows how to reproduce the problem on a clean Windows 11 or Windows Server box (with just VS Code + VS Code PowerShell extension installed).

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had activity from the community in the last 30 days. It will be closed if no further activity occurs within 40 days. If the issue is labelled with any of the work labels (e.g bug, enhancement, documentation, or tests) then the issue will not auto-close.

@github-actions github-actions bot added the stale The issue or pull request was marked as stale because there hasn't been activity from the community. label Sep 22, 2023
Copy link

github-actions bot commented Nov 1, 2023

This issue has been automatically closed because it is has not had activity from the community in the last 40 days. If this issue was wrongly closed, for a issue author please comment and re-open it, if you are not the issue author comment with a reason for it to be reopened and tag a maintainer in the comment.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 1, 2023
@rismoney
Copy link

rismoney commented Dec 5, 2023

I think I am experiencing this issue

I ran the following command but got Get-CimClass: Not Found

$resource = Get-DscResource -Name sqlpermission 
Get-CimClass -ClassName $resource.ResourceType -Namespace root\Microsoft\Windows\DesiredStateConfiguration

I am attempting to use this under puppet, and it cannot find sqlpermission. $resource has a value, and I see it, but I think it is not properly registering. PS 5.1, Win2022

@johlju
Copy link
Member

johlju commented Dec 5, 2023

I think this is not related to the issue. If Puppet is suppose to work with class-based resources then please open a new issue. Suggest talking to the Puppet team as well as the resource works with LCM in Windows, so just be related to Puppet.

@rismoney
Copy link

rismoney commented Dec 5, 2023

thank you, puppet is supposed to work with class based resoures as they state: I think it is how they autowrap the dsc module, and then templatize the parameters. I reached out to them, and opened issues on their dsc repo, since I think it might not be related to this repo, albeit the changes madeover the last year, may have created an incompatiblity with what they were doing.

Class-based DSC Resources can be used like any other DSC Resource in this module, with one important note: Due to a bug in calling class-based DSC Resources by path instead of module name, each call to Invoke-DscResource needs to temporarily munge the system-level environment variable for PSModulePath; the variable is reset prior to the end of each invocation.

@raandree
Copy link

PS 7.x won't work since it does not support DSC resources in the way that Windows PowerShell does. See the work being done for DSCv3.

Hi @johlju, why do you think it does not and should not work. I am using a bunch of class-based DSC resources in PowerShell and so far all of them could be discovered correctly.

But, we are experiencing the same issue. The SqlPermission resource can be found on PS5 but not on PS7.

@raandree raandree reopened this Jan 15, 2025
@github-actions github-actions bot removed the stale The issue or pull request was marked as stale because there hasn't been activity from the community. label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for author response The pull request is waiting for the author to respond to comments in the pull request.
Projects
None yet
Development

No branches or pull requests

3 participants