mirror of
https://github.com/PowerShell/PSDscResources
synced 2026-06-21 13:45:29 +00:00
Fix Get-DscConfiguration for Registry
This commit is contained in:
@@ -66,6 +66,9 @@ function Get-TargetResource
|
||||
$registryResource = @{
|
||||
Key = $Key
|
||||
Ensure = 'Absent'
|
||||
ValueName = $null
|
||||
ValueType = $null
|
||||
ValueData = $null
|
||||
}
|
||||
|
||||
# Retrieve the registry key at the specified path
|
||||
@@ -104,7 +107,7 @@ function Get-TargetResource
|
||||
$actualValueType = Get-RegistryKeyValueType -RegistryKey $registryKey -RegistryKeyValueName $ValueName
|
||||
|
||||
# If the registry key value exists, convert it to a readable string
|
||||
$registryKeyValueAsReadableString = ConvertTo-ReadableString -RegistryKeyValue $registryKeyValue -RegistryKeyValueType $actualValueType
|
||||
$registryKeyValueAsReadableString = @() + (ConvertTo-ReadableString -RegistryKeyValue $registryKeyValue -RegistryKeyValueType $actualValueType)
|
||||
|
||||
$registryResource['Ensure'] = 'Present'
|
||||
$registryResource['ValueType'] = $actualValueType
|
||||
|
||||
@@ -24,8 +24,6 @@ $script:testEnvironment = Enter-DscResourceTestEnvironment `
|
||||
-DscResourceName 'MSFT_RegistryResource' `
|
||||
-TestType 'Integration'
|
||||
|
||||
$VerbosePreference = 'Continue'
|
||||
|
||||
try
|
||||
{
|
||||
Describe 'Registry End to End Tests' {
|
||||
@@ -353,7 +351,6 @@ try
|
||||
}
|
||||
finally
|
||||
{
|
||||
$VerbosePreference = 'SilentlyContinue'
|
||||
Exit-DscResourceTestEnvironment -TestEnvironment $script:testEnvironment
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user