eventcreate /T Information /ID 100 /L APPLICATION /SO AcerPRO /D 'Start to execuite RecoveryScript.ps1';
$eventContent = $args[0];
#Parse the contents and put the parameters into an array
$eventContent = $eventContent.Split(':');
#Check to ensure all of the expected parameters have been passed
if($eventContent.Count -Lt 4) { eventcreate /T Error /ID 100 /L APPLICATION /SO AcerPRO /D 'Invalid number of parameters are passed to the RecoveryScript.ps1.'; return; }
#Add the VMM PowerShell Snapin so you can use the cmdlets
add-pssnapin -name Microsoft.SystemCenter.VirtualMachineManager;
#eventcreate /T Information /ID 100 /L APPLICATION /SO AcerPRO /D 'establish connection';
#Establish connection to the VMM server
$VMMServer = get-vmmserver -computerName $serverName;
$VMHost = Get-VMHost -ComputerName $hostName;
Write-Host "Placing host" $VMHost "into maintenance mode.";
eventcreate /T Information /ID 100 /L APPLICATION /SO AcerPRO /D 'Start to execute Disable-VMHost cmdlet';
Disable-VMHost $VMHost -PROTipID $ProtipId;
#eventcreate /T Information /ID 100 /L APPLICATION /SO AcerPRO /D 'set pro tip status';
#Set the PRO tip status to Resolved once the processing is complete
Set-PROTip -PROTipId $ProtipId -TipStatus Resolved; </Script></Contents>
</File>
</Files>
</WriteAction>
</MemberModules>
<Composition>
<Node ID="Recovery"/>
</Composition>
</Composite>
</ModuleImplementation>
<OutputType>System!System.CommandOutput</OutputType>
<InputType>System!System.BaseData</InputType>
</WriteActionModuleType>