DL4300 Appliance
PostExportScript.ps1
519
[System.Reflection.Assembly]::LoadFrom($regVal) | out-null
# Converting input parameter into specific object
$TransferPostscriptParameterObject = $TransferPostscriptParameter -as [Replay.Common.Contracts.PowerShellExecution.TransferPostscriptParameter];
# Working with input object. All echo's are logged
if($TransferPostscriptParameterObject -eq $null) {
echo 'TransferPostscriptParameterObject parameter is null'
}
else {
echo 'VolumeNames:' $TransferPostscriptParameterObject.VolumeNames
echo 'ShadowCopyType:' $TransferPostscriptParameterObject.ShadowCopyType
echo 'ForceBaseImage:' $TransferPostscriptParameterObject.ForceBaseImage
echo 'IsLogTruncation:' $TransferPostscriptParameterObject.IsLogTruncation
}
Parent topic
PreExportScript.ps1
The PreExportScript is run on the Core before any export job.
Sample PreExportScript
# 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 = $ '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
}
Parent topic
PostExportScript.ps1
The PostExportScript is run on the Core after any export job.
NOTE:
There are no input parameters for the PostExportScript when used to run once on the exported
protected machine after initial startup. The regular protected machine should contain this script in the
PowerShell script folder as PostExportScript.ps1.
Sample 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 = $ 'CoreService\Common.Contracts.dll'