Guest User

Untitled

a guest
Aug 5th, 2012
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. How to execute an action based on registry values?
  2. $rKey="hklm:SOFTWAREWow6432NodeMycompanyMyProjCore"
  3.  
  4. DBServer="Installed"
  5. AppServer="Installed"
  6. WebServer="Installed"
  7.  
  8. if DBserver="Installed" Then do some action
  9. Else Do nothing
  10.  
  11. If Appserver="Installe" then do some action
  12. Else Do nothing
  13.  
  14. If Webserver ="Installed" then do some action
  15. Else Do nothing
  16.  
  17. $p = Get-ItemProperty $key
  18.  
  19. if($p.DBserver -eq "Installed")
  20. {
  21. .. do some action ..
  22. }
  23.  
  24. if($p.Appserver-eq "Installed")
  25. {
  26. .. do some action ..
  27. }
  28.  
  29. if($p.Webserver -eq "Installed")
  30. {
  31. .. do some action ..
  32. }
Advertisement
Add Comment
Please, Sign In to add comment