
Untitled
By: a guest on
Aug 5th, 2012 | syntax:
None | size: 0.57 KB | hits: 12 | expires: Never
How to execute an action based on registry values?
$rKey="hklm:SOFTWAREWow6432NodeMycompanyMyProjCore"
DBServer="Installed"
AppServer="Installed"
WebServer="Installed"
if DBserver="Installed" Then do some action
Else Do nothing
If Appserver="Installe" then do some action
Else Do nothing
If Webserver ="Installed" then do some action
Else Do nothing
$p = Get-ItemProperty $key
if($p.DBserver -eq "Installed")
{
.. do some action ..
}
if($p.Appserver-eq "Installed")
{
.. do some action ..
}
if($p.Webserver -eq "Installed")
{
.. do some action ..
}