使用 powershell 根据值删除注册表项 [英] Delete a registry entry based on the value using powershell

查看:36
本文介绍了使用 powershell 根据值删除注册表项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要根据其值删除一个注册表项.例如,密钥将驻留在:

I need to delete a registry entry based on its value. For example, the key will reside in:

HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

DisplayName 键将包含 StackOverFlow.

这些注册表项的名称是GUID,因此是随机的,所以我不能只搜索它们,唯一的方法就是上面的那个.

The names of these registry keys are GUID, therefore random, so I can't just search for them, the only way is the one above.

推荐答案

$path = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'

gci $path |? {$_.GetValue('DisplayName') -match 'StackOverflow'} | del

这篇关于使用 powershell 根据值删除注册表项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆