install software only if Role="something "& Environment ="something2"
trying control software deployment servers role="something "& environment ="something2". instead of hard coding names.
foreach ($package in $node.packages)
{
$packagenamee = "bp_" + $package.shortname
if (($pack.role -eq $node.role) -or ($pack.role -eq $null))
{
write-verbose "configure package $($package.name) roles '$($pack.role)' on node role $($node.role)"
package $packagename
{
name = $package.name
path = $package.path
productid = $package.productid
}
}
}
the existing script has refers psd1 file has allnodes = @( existing software installs
hi totalnet32,
thanks post. if you've defined related environment variables then, yes, use if condition combine , criteria meets, start install software action.
for create or modify environment variables can refer below link:
https://technet.microsoft.com/en-us/library/ff730964.aspx?f=255&mspperror=-2147217396
hope helps.
best regards,
elaine
please remember mark replies answers if , unmark them if provide no help. if have feedback technet subscriber support, contact tnmff@microsoft.com.
Windows Server > Windows PowerShell
Comments
Post a Comment