echo 'ExportJobRequestObject parameter is null'
}
else {
echo 'Location:' $ExportJobRequestObject.Location
echo 'Priority:' $ExportJobRequestObject.StorageConfiguration
}
Postexportscript.ps1
Das PostExportScript wird auf der Kernseite nach einer Exportaufgabe ausgeführt.
ANMERKUNG: Es gibt keine Eingabe-Parameter für das PostExportScript, wenn es einmal zur Ausführung auf dem
exportierten Agenten nach dem ersten Starten verwendet wurde. Reguläre Agenten enthält dieses Skript im
PowerShell-Skriptordner unter PostExportScript.ps1.
# 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
Das PreNightlyJobScript wird auf der Kernseite vor jeder allnächtlichen Aufgabe ausgeführt. Es trägt den Parameter
$JobClassName, der bei der separaten Behandlung von solch untergeordneten Aufgaben hilft.
# receiving parameters from Nightlyjob
param([System.String]$JobClassMethod , [object]
$NightlyAttachabilityJobRequest,
[object]$RollupJobRequest, [object]$Agents, [object]$ChecksumCheckJobRequest,
[object]$TransferJobRequest, [int]$LatestEpochSeenByCore)
# 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
202