Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 5th, 2012  |  syntax: None  |  size: 0.57 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }