Skip to Content
PowerShell 烹饪书,第 4 版
book

PowerShell 烹饪书,第 4 版

by Lee Holmes
May 2025
Intermediate to advanced
1002 pages
12h 51m
Chinese
O'Reilly Media, Inc.
Content preview from PowerShell 烹饪书,第 4 版

第 21 章 Windows 注册表 Windows 注册表

本作品已使用人工智能进行翻译。欢迎您提供反馈和意见:translation-feedback@oreilly.com

21.0 引言

作为绝大多数应用程序的配置存储库,注册表在系统管理中发挥着核心作用。它通常也很难管理。

虽然有命令行工具(如reg.exe)可以帮助你处理注册表,但它们的界面通常不一致且容易混淆。注册表编辑器图形用户界面易于使用,但不支持脚本管理。

PowerShell 通过将 Windows 注册表作为导航提供程序来解决这个问题:这是一个数据源,您可以用与使用文件系统完全相同的方式对其进行导航和管理。

21.2 查看注册表密钥

问题

您 希望查看特定注册表键值。

解决方案

要 检索注册表键值,请使用Get-ItemProperty cmdlet,如例 21-1 所示。

例 21-1. 检索注册表键值的属性
PS > Set-Location HKCU: PS > Set-Location \Software\Microsoft\Windows\CurrentVersion\Run PS > Get-ItemProperty . PSPath : Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_U SER\Software\Microsoft\Windows\CurrentVersion\Run PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_U SER\Software\Microsoft\Windows\CurrentVersion PSChildName : Run PSDrive : HKCU PSProvider : Microsoft.PowerShell.Core\Registry FolderShare : "C:\Program Files\FolderShare\FolderShare.exe" / background TaskSwitchXP : d:\lee\tools\TaskSwitchXP.exe ctfmon.exe ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

《SQL 概论》,第 4 版

《SQL 概论》,第 4 版

Kevin Kline, Regina O. Obe, Leo S. Hsu
《Java 思维》,第二版

《Java 思维》,第二版

Allen B. Downey, Chris Mayfield

Publisher Resources

ISBN: 9798341657984