Registre powershell

De Linuxmemo.

(Différences entre les versions)
(Page créée avec « Catégorie:PowerShell #Lire une clé Get-Item HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ #Lire une valeur Get-ItemProperty HKCU:\SOFTWARE\Micro... »)
Ligne 18 : Ligne 18 :
  Remove-Item -Path HKLM:\SYSTEM\CurrentControlSet\services\SNMP\Parameters\RFC1156Agent\test
  Remove-Item -Path HKLM:\SYSTEM\CurrentControlSet\services\SNMP\Parameters\RFC1156Agent\test
-
#Gestion des propriétés. Les types supportés sont: String ExpandString Binary DWord Multistring QWord
+
==Gestion des propriétés==
 +
Les types supportés sont: String ExpandString Binary DWord Multistring QWord
 +
 
#Créer une nouvelle propriété
#Créer une nouvelle propriété
  New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\services\SNMP\Parameters\RFC1156Agent -ItemType String -Name foo -Value bar
  New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\services\SNMP\Parameters\RFC1156Agent -ItemType String -Name foo -Value bar
Ligne 30 : Ligne 32 :
#Supprimer une propriété
#Supprimer une propriété
  Remove-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\services\SNMP\Parameters\RFC1156Agent -Name foo
  Remove-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\services\SNMP\Parameters\RFC1156Agent -Name foo
 +
==Astuces==
 +
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ -name Hidden -Value 1

Version du 13 juin 2017 à 16:29

  1. Lire une clé
Get-Item HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\
  1. Lire une valeur
Get-ItemProperty HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ -name Hidden
  1. Créer une nouvelle clé
New-Item -Path HKLM:\SYSTEM\CurrentControlSet\services\SNMP\Parameters\RFC1156Agent\test
  1. Définir la valeur (par défaut) d’une clé
Set-Item -Path HKLM:\SYSTEM\CurrentControlSet\services\SNMP\Parameters\RFC1156Agent\test -Value foo
  1. Renommer une clé
Rename-Item -Path HKLM:\SYSTEM\CurrentControlSet\services\SNMP\Parameters\RFC1156Agent\test -NewName foo
  1. Supprimer une clé
Remove-Item -Path HKLM:\SYSTEM\CurrentControlSet\services\SNMP\Parameters\RFC1156Agent\test

Gestion des propriétés

Les types supportés sont: String ExpandString Binary DWord Multistring QWord

  1. Créer une nouvelle propriété
New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\services\SNMP\Parameters\RFC1156Agent -ItemType String -Name foo -Value bar
  1. Définir la valeur d’une propriété
Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\services\SNMP\Parameters\RFC1156Agent -Name foo -Value bar
  1. Renommer une propriété
Rename-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\services\SNMP\Parameters\RFC1156Agent -Name foo -NewName bar
  1. Supprimer une propriété
Remove-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\services\SNMP\Parameters\RFC1156Agent -Name foo

Astuces

Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\ -name Hidden -Value 1
Outils personnels