1.常用指令(*-Item處理"檔案夾",*-ItemProperty處理"檔案")
Get-ItemGet-ItemProperty
Set-ItemSet-ItemProperty
New-ItemNew-ItemProperty
Copy-ItemCopy-ItemProperty
Rename—ItemRename-ItemProperty
Remove-ItemRemove-ItemProperty
Clear-ItemClear-ItemProperty
2.轉到系統資料庫根部
Set-Location-PathMicrosoft.PowerShell.Core\Registry::
Get-ChildItem–Recurse
3.讀取系統資料庫
Push-LocationHKLM:SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run
Get-ItemPropertyOptionalComponents
4、建立系統資料庫的值
Pop-Location
New-Item-PathHKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run-Name"PS"–Force
New-ItemProperty-PathHKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run-Name"VS2010"-Value"E:\Dotnet\MicrosoftVisualStudio10.0\Common7\IDE\devenv.exe"-
PropertyTypestring–Force
-PropertyType的枚舉值
Binary二進制資料
DWord一個有效的UInt32數字
ExpandString一個可以包含動态擴充的環境變量的字元串
MultiString多行字元串
string任何字元串值
QWord8位元組二進制資料
5.更改系統資料庫的值
Set-Item-PathHKLM:SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run\PS-Value"PSV2"-Force-PassThru
Set-ItemProperty-PathHKLM:SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run-Name"VS2010"-Value"E:\"–PassThru
6.清空系統資料庫的值
Clear-Item-PathHKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run\PS
Clear-ItemProperty-PathHKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run-Name"VS2010"–PassThru
7.删除系統資料庫項
Remove-Item-PathHKLM:SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run\PS-Force
Remove-ItemProperty-PathHKLM:SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Run-Name"VS2010"