-
Notifications
You must be signed in to change notification settings - Fork 225
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: Get-TargetResource expects a mandatory parameter #1761
Comments
Agree that it looks like the |
Happy to review a PR that fixes this. 🙂 |
Added permission parameter as a mandatory param. dsccommunity#1761
to resolve issue dsccommunity#1761
Kindly review. Thanks |
PR looks okay. But looking at the resource as a whole I think the entire resource should be refactored to remove Ensure parameter. It should instead have the parameters |
- SqlPermission - The `Permission` parameter is now mandatory for all `*-TargetResource` (issue #1761).
…urce) (#1778) - SqlServerDsc - The following classes were added to the module: - `ServerPermission` - complex type for the DSC resource SqlPermission. - The following public functions were added to the module (see comment-based help for more information): - `Test-SqlDscIsLogin` - `ConvertFrom-SqlDscServerPermission` - `ConvertTo-SqlDscServerPermission` - `Get-SqlDscServerPermission` - `Set-SqlDscServerPermission` - SMO stubs (used in the unit tests) - Was updated to remove a bug related to the type `ServerPermissionInfo` when used with the type `ServerPermissionSet`. The stubs suggested that the property `PermissionType` (of type `ServerPermissionSet`) in `ServerPermissionInfo` should have been a array `ServerPermissionSet[]`. This conflicted with real SMO as it does not pass an array, but instead a single `ServerPermissionSet`. The stubs was modified to mimic the real SMO. At the same time some old mock code in the SMO stubs was removed as it was no longer in use. - SqlPermission - BREAKING CHANGE: The resource has been refactored. The parameters `Permissions` has been replaced by parameters `Permission`, `PermissionToInclude`, and `PermissionToExclude`. These permissions parameters are now an instance of the type `ServerPermission`. The type `ServerPermission` contains two properties; `State` and `Permission`. This closes the issue [issue #1761](#1761), it also fixes the issues [issue #1773](#1773), [issue #1704](#1704), and [issue #752](#752). - The resource was refactored into a class-based resource. - SqlDatabasePermission - Fixed comment-based help and cleaned up comments. - Fix localized string that referenced 'user' instead of 'principal', and correct localized string ID for each string. - `Set-SqlDscDatabasePermission` - Minor code cleanup.
Problem description
When doing a get on SQLPermission resource it expects the parameter 'permission' to be passed into it. If the permission parameter isn't passed through then we hit an Exception.
Verbose logs
DSC configuration
Suggested solution
make permission to be a mandatory parameter in the sqlpermission resource. Doing this returns without any problems.
SQL Server edition and version
SQL Server PowerShell modules
Operating system
PowerShell version
SqlServerDsc version
The text was updated successfully, but these errors were encountered: