DL4300 Appliance
PostTransferScript.ps1
518
Sample PowerShell scripts
The following sample scripts are provided to assist administrative users in executing PowerShell scripts.
Parent topic
Related references
See also:
See also:
See also:
See also:
See also:
See also:
PreTransferScript.ps1
The PreTransferScript is run on the protected machine before transferring a snapshot.
Sample PreTransferScript
# receiving parameter from transfer job
param([object]$TransferPrescriptParameter)
# building path to Agent's Common.Contracts.dll and loading this assembly
$regLM = [Microsoft.Win32.Registry]::LocalMachine
$regLM = $regLM.OpenSubKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AppRecovery Agent 5')
$regVal = $regLM.GetValue('InstallLocation')
$regVal = $ 'Common.Contracts.dll'
[System.Reflection.Assembly]::LoadFrom($regVal) | out-null
# Converting input parameter into specific object
$TransferPrescriptParameterObject = $TransferPrescriptParameter -as [Replay.Common.Contracts.PowerShellExecution.TransferPrescriptParameter];
# Working with input object. All echo's are logged
if($TransferPrescriptParameterObject -eq $null) {
echo 'TransferPrescriptParameterObject parameter is null'
}
else {
echo 'TransferConfiguration:'$TransferPrescriptParameterObject.TransferConfiguration
echo 'StorageConfiguration:' $TransferPrescriptParameterObject.StorageConfiguration
}
Parent topic
PostTransferScript.ps1
The PostTransferScript is run on the protected machine after transferring a snapshot.
Sample PostTransferScript
# receiving parameter from transfer job
param([object] $TransferPostscriptParameter)
# building path to Agent's Common.Contracts.dll and loading this assembly
$regLM = [Microsoft.Win32.Registry]::LocalMachine
$regLM = $regLM.OpenSubKey('SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\AppRecovery Agent 5')
$regVal = $regLM.GetValue('InstallLocation')
$regVal = $ 'Common.Contracts.dll'
Содержание DL4300
Страница 1: ...DL4300 Appliance User Guide...