Hello,
You can try something like this .. At first try Get-WmiObject Win32_Product | ? { $_.Name -like "*Forefront*" } locally, i don't have forefront here so i don't know how it's named in Win32_Product list
$GuestUser = "Administrator"
$Password = "PutYourPasswordHere"
$Script = '
if (Get-WmiObject Win32_Product | ? { $_.Name -like "*Forefront*" }) {
Write-Host "Forefront installed"
}
'
Get-VM | % {
$VM = $_
Get-View $_ | % {
if ( $_.Summary.Guest.GuestFullName -contains "Windows" ) {
Invoke-VMScript -VM $VM -ScriptText $script -ScriptType Powershell -GuestUser $GuestUser -GuestPassword $Password
}
}