Files
Resolve-DSCConfigurationData/Public/Resolve-DSCConfigurationData.ps1
Torsten Brendgen 45e71c093c Refactor secret management providers and introduce unified handling
- Removed KeePass and SecretStore provider implementations.
- Integrated KeePass and SecretStore as vaults under the SecretManagement provider.
- Added new functions: Get-DSCConfigurationDataCredentialProvider and Set-DSCConfigurationDataCredentialProvider for managing credential providers.
- Implemented Unlock-ConfigurationDataSecretManagementVault to handle vault unlocking with master passwords.
- Updated README to reflect changes in provider usage and examples.
- Enhanced error handling and validation for vault registration and settings.
2026-07-06 22:50:39 +02:00

39 lines
1.3 KiB
PowerShell

function Resolve-DSCConfigurationData {
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true, ValueFromPipeline=$true)]
[System.Collections.Hashtable]
$ConfigurationData,
[Parameter(Mandatory=$false)]
[hashtable]
$ProviderSettings = @{},
[Parameter(Mandatory=$false)]
[string]
$ProviderSettingsPath,
[Parameter(Mandatory=$false)]
[switch]
$SkipSecrets
)
process {
if(-not [string]::IsNullOrWhiteSpace($ProviderSettingsPath)){
if(-not (Test-Path -Path $ProviderSettingsPath -PathType Leaf)){
throw "Provider settings file [$ProviderSettingsPath] was not found."
}
$ProviderSettings = Import-PowerShellDataFile -Path $ProviderSettingsPath
}
if(-not $SkipSecrets){
Unlock-ConfigurationDataSecretManagementVault -ProviderSettings $ProviderSettings
$ConfigurationData = Resolve-ConfigurationDataParameterSecrets -ConfigurationData $ConfigurationData -ProviderSettings $ProviderSettings
}
$Context = New-ConfigurationDataResolutionContext -ConfigurationData $ConfigurationData
return Resolve-ConfigurationDataValue -Value $ConfigurationData -Context $Context
}
}