RegistryFunctions
I needed a PowerShell script to get and set registry values on Windows 2003 machines that have no PowerShell installed.
So I wrote this module that uses WMI to handle the remote registry.
This module RegistryFunctions.psm1 exposes the following functions:
- Get-RegistryValue
- Set-RegistryValue
Syntax Get-RegistryValue
Get-RegistryValue [[-ComputerName] <String>] [[-Hive] <String>] [-Path] <String> [-Key] <String>[<CommonParameters>]
Example
Get-RegistryValue $strComputer "HKLM" "SOFTWARE\Acronis\afcdp" "build"
Syntax Set-RegistryValue
Set-RegistryValue [[-ComputerName] <String>] [[-Hive] <String>] [-Path] <String> [-Key] <String> [-Value] <Object>[[-Keytype] <String>] [<CommonParameters>]
Example
$arrActions = @("StopA", "StartB", "StartC")
Set-RegistryValue -Computername $strComputer -Hive "HKLM" -Path "SOFTWARE\Quasar" -Key "Actions" -Value $arrActions -Keytype "REG_MULTI_SZ"