Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. Function Get-RegistryKeyPropertiesAndValues
  2. {
  3. Param(
  4.  
  5. [Parameter(Mandatory=$true)]
  6. [string]$path)
  7.  
  8. Push-Location
  9.  
  10. Set-Location -Path $path
  11.  
  12. Get-Item . |
  13.  
  14. Select-Object -ExpandProperty property |
  15.  
  16. ForEach-Object {
  17.  
  18. New-Object psobject -Property @{“property”=$_;
  19.  
  20. “Value” = (Get-ItemProperty -Path . -Name $_).$_}}
  21.  
  22. Pop-Location
  23. }
  24.  
  25. $RegistryPath = Get-RegistryKeyPropertiesAndValues
  26. HKCU:SoftwareXYZABCAutostart | ft value -AutoSize
  27.  
  28. $RegistryPath
  29.  
  30. ForEach-Object {
  31.  
  32. New-Object psobject -Property @{“property”=$_;
  33. $Value = Get-ItemProperty -Path
  34. {ExecuteCommand} $Value
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement