Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2018
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. Function Baseline
  2. {
  3. $pathways=@()
  4. $pathways+= "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Notifications\Data"
  5. $pathways+= "HKLM:\SYSTEM\ControlSet001\Services\bam\UserSettings"
  6. $pathways+= "HKLM:\SYSTEM\CurrentControlSet\Services\W32Time\SecureTimeLimits"
  7. $pathways+= "HKLM:\SYSTEM\CurrentControlSet\Services\W32Time\SecureTimeLimits\RunTime"
  8. $pathways+= "HKU:\S-1-5-21-477002440-2142131239-270007453-1001\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist"
  9.  
  10. remove-item -Path "C:\Users\Student\Desktop\Good\Gtext.txt" -ErrorAction SilentlyContinue
  11. foreach ($path in $pathways)
  12. {
  13. get-item -path $path -ErrorAction SilentlyContinue | out-file -Append -PSPath "C:\Users\Student\Desktop\Good\Gtext.txt"
  14. }
  15. }
  16.  
  17. Function BBaseline
  18. {
  19. $pathways=@()
  20. $pathways+= "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Notifications\Data"
  21. $pathways+= "HKLM:\SYSTEM\ControlSet001\Services\bam\UserSettings"
  22. $pathways+= "HKLM:\SYSTEM\CurrentControlSet\Services\W32Time\SecureTimeLimits"
  23. $pathways+= "HKLM:\SYSTEM\CurrentControlSet\Services\W32Time\SecureTimeLimits\RunTime"
  24. $pathways+= "HKU:\S-1-5-21-477002440-2142131239-270007453-1001\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist"
  25.  
  26. remove-item -Path "C:\Users\Student\Desktop\Good\Btext.txt" -ErrorAction SilentlyContinue
  27. foreach ($path in $pathways)
  28. {
  29. get-item -path $path -ErrorAction SilentlyContinue | out-file -Append -PSPath "C:\Users\Student\Desktop\Good\Btext.txt"
  30. }
  31. }
  32.  
  33. Function Test101
  34. {
  35. remove-item -Path "C:\Users\Student\Desktop\Good\text.txt" -ErrorAction SilentlyContinue
  36. $fileGood = "C:\Users\Student\Desktop\Good\Gtext.txt"
  37. $fileBad = "C:\Users\Student\Desktop\Good\Btext.txt"
  38. Compare-Object(Get-Content $fileGood) (Get-Content $fileBad) | out-file "C:\Users\Student\Desktop\Good\text.txt" #| where {$_.sideindicator -eq "=>"}
  39. }
  40.  
  41. Function Run-it
  42. {
  43. Baseline
  44. BBaseline
  45. Test101
  46. }
  47.  
  48.  
  49. #"HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Notifications\Data"
  50. #"HKLM\SYSTEM\ControlSet001\Services\bam\UserSettings"
  51. #"HKLM\SYSTEM\CurrentControlSet\Services\W32Time\SecureTimeLimits"
  52. #"HKLM\SYSTEM\CurrentControlSet\Services\W32Time\SecureTimeLimits\RunTime"
  53. #"HKU\S-1-5-21-477002440-2142131239-270007453-1001\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement