Users Guide

$regLM = [Microsoft.Win32.Registry]::LocalMachine
$regLM = $regLM.OpenSubKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AppRecovery
Core 5')
$regVal = $regLM.GetValue('InstallLocation')
$regVal = $regVal + 'CoreService\Common.Contracts.dll'
[System.Reflection.Assembly]::LoadFrom($regVal) | out-null
# Converting input parameter into specific object
$ExportJobRequestObject = $ExportJobRequest -as
[Replay.Core.Contracts.Export.ExportJobRequest]
# Working with input object. All echo's are logged
if($ExportJobRequestObject -eq $null) {
echo 'ExportJobRequestObject parameter is null'
}
else {
echo 'Location:' $ExportJobRequestObject.Location
echo 'Priority:' $ExportJobRequestObject.Priority
}
PostExportScript.ps1
PostExportScript s'exécute sur le core après toute tâche d'exportation.
REMARQUE : Il n'existe pas de paramètres d'entrée pour PostExportScript lorsqu'il est exécuté une fois sur la machine protégée
exportée après le démarrage initial. La machine protégée régulière doit contenir ce script dans le dossier des scripts PowerShell sous
le nom PostExportScript.ps1.
Exemple PostExportScript
# receiving parameter from export job
param([object]$ExportJobRequest)
# building path to Core's Common.Contracts.dll and loading this assembly
$regLM = [Microsoft.Win32.Registry]::LocalMachine
$regLM = $regLM.OpenSubKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AppRecovery
Core 5')
$regVal = $regLM.GetValue('InstallLocation')
$regVal = $regVal + 'CoreService\Common.Contracts.dll'
[System.Reflection.Assembly]::LoadFrom($regVal) | out-null
$regVal2 = $regLM.GetValue('InstallLocation')
$regVal2 = $regVal2 + 'CoreService\Common.Contracts.dll'
# Converting input parameter into specific object
$ExportJobRequestObject = $ExportJobRequest -as
[Replay.Core.Contracts.Export.ExportJobRequest]
# Working with input object. All echo's are logged
if($ExportJobRequestObject -eq $null) {
echo 'ExportJobRequestObject parameter is null'
}
else {
echo 'VolumeImageIds:' $ExportJobRequestObject.VolumeImageIds
echo 'RamInMegabytes:' $ExportJobRequestObject.RamInMegabytes
}
PreNightlyJobScript.ps1
PreNightlyJobScript s'exécute avant chaque tâche nocturne sur le core. ll contient le paramètre $JobClassName qui facilite la gestion de
ces tâches enfant séparément.
Exemple PreNightlyJobScript
# receiving parameters from Nightlyjob
param([System.String]$JobClassMethod , [object]$NightlyAttachabilityJobRequest, [object]
$RollupJobRequest, [object]$Agents, [object]$ChecksumCheckJobRequest, [object]
$TransferJobRequest, [int]$LatestEpochSeenByCore)
Extension des tâches Rapid Recovery avec des scripts
463