dsccommunity / SqlServerDsc

This module contains DSC resources for deployment and configuration of Microsoft SQL Server.
MIT License
360 stars 225 forks source link

SqlDatabasePermission: Return the correct username from Get-method for the Credential property #1983

Closed johlju closed 11 months ago

johlju commented 11 months ago

Instead of this code:

https://github.com/dsccommunity/SqlServerDsc/blob/22b25f68761fdb62afa41e92f0ac279bc64cf4b3/source/Classes/020.SqlDatabasePermission.ps1#L204-L212

Maybe this will work:

https://github.com/dsccommunity/WebAdministrationDsc/blob/4c8f0631ac16190138e99c7c4bf58e35e6d12e97/source/Modules/WebAdministrationDsc.Common/WebAdministrationDsc.Common.psm1#L152-L200

If it do work then I suggest that the command is moved to DscResource.Common.

johlju commented 11 months ago

This won't work as the property of a class is of the type PSCredential and not a CIM instance type. This was not the solution for class-based resource.