小编Ver*_*Ray的帖子

DSC-Resource:如何删除注册表项(不是值)?

我知道我可以通过使用以下脚本块来确保特定注册表值的存在:

    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......

powershell dsc

5
推荐指数
1
解决办法
1285
查看次数

标签 统计

dsc ×1

powershell ×1