我知道我可以通过使用以下脚本块来确保特定注册表值的存在:
Registry ConfigureRegistry
{
Ensure = 'Present'
Key = 'HKEY_LOCAL_MACHINE\SOFTWARE\SomeKey'
ValueName = 'MachineType'
ValueData = 'Hyper-V'
}
Run Code Online (Sandbox Code Playgroud)
但是如何删除注册表项SomeKey
?如果我只将关键字更改Ensure = "Present"
为Ensure = "Absent"
它会留下密钥SomeKey
......