This project is read-only.

NAME

Remove-RegValue

SYNOPSIS

Deletes the specified registry value from local or remote computers.

SYNTAX

Remove-RegValue [[-ComputerName] <>] [[-Hive] <>] [-Key] <> [-Value] <> [-Force] [-View] [-Ping] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

 

PARAMETERS

-ComputerName <String[]>

Adds a new member even the object has a custom member with the same name. You cannot use the Force parameter to replace a standard member of a type.

Required? false
Position? 1
Default value $env:COMPUTERNAME
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false

 

-Hive <String>

Adds a new member even the object has a custom member with the same name. You cannot use the Force parameter to replace a standard member of a type.

Required? false
Position? 2
Default value LocalMachine
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

 

-Key <String>

Adds a new member even the object has a custom member with the same name. You cannot use the Force parameter to replace a standard member of a type.

Required? true
Position? 3
Default value  
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

 

-Value <String>

Adds a new member even the object has a custom member with the same name. You cannot use the Force parameter to replace a standard member of a type.

Required? true
Position? 4
Default value  
Accept pipeline input? true (ByPropertyName)
Accept wildcard characters? false

 

-Force <SwitchParameter>

Adds a new member even the object has a custom member with the same name. You cannot use the Force parameter to replace a standard member of a type.

Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false

 

-View <RegistryView>

Adds a new member even the object has a custom member with the same name. You cannot use the Force parameter to replace a standard member of a type.

Required? false
Position? named
Default value Default
Accept pipeline input? false
Accept wildcard characters? false

 

-Ping <SwitchParameter>

Adds a new member even the object has a custom member with the same name. You cannot use the Force parameter to replace a standard member of a type.

Required? false
Position? named
Default value False
Accept pipeline input? false
Accept wildcard characters? false

 

-WhatIf <SwitchParameter>

Adds a new member even the object has a custom member with the same name. You cannot use the Force parameter to replace a standard member of a type.

Required? false
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? false

 

-Confirm <SwitchParameter>

Adds a new member even the object has a custom member with the same name. You cannot use the Force parameter to replace a standard member of a type.

Required? false
Position? named
Default value  
Accept pipeline input? false
Accept wildcard characters? false

 

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS

 

OUTPUTS

 

NOTES

Author: Shay Levy
Blog : http://PowerShay.com

EXAMPLES

-------------------------- EXAMPLE 1 --------------------------

C:\PS>$Key = "SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer"

Test-RegValue -Key $Key -Value NoDriveTypeAutorun -ComputerName SERVER1,SERVER2 -PassThru | Remove-RegValue -Force

Description
-----------
The command checks if the NoDriveTypeAutorun key value on SERVER1 and SERVER2. When using the PassThru parameter, each value, if found, it emitted to the pipeline.
Each value found that is piped into Remove-RegValue is deleted without any confirmations.

-------------------------- EXAMPLE 2 --------------------------

C:\PS>[Environment]::Is64BitProcess

False

PS> Remove-RegValue -Hive LocalMachine -Key SOFTWARE\MyKey -ComputerName Server1 -Value 64String -View Registry64 -Force


Description
-----------
This command is using an elevated 32-bit instance of Windows PowerShell to remove a value
from a 64-bit registry section of a remote 64-bit server. First we verify that the current console
is a 32-bit instance by using the Is64BitProcess system environment variable.

Connecting to the 64-bit section of the remote server registry is done using the View
parameter.

RELATED LINKS

http://psrr.codeplex.com
Get-RegValue Test-RegValue

Last edited Jun 11, 2012 at 1:44 PM by Shay, version 2

Comments

No comments yet.