Users Guide
下表显示 VolumeNameCollection 参数可用的对象。
表. 314: VolumeNameCollection 参数的对象
方法 说明
public override bool Equals(object obj) 确定此实例和同样为 VolumeNameCollection 对象的某个指定对象是否具有相同的值。
(Overrides Object.Equals(Object).)
public override int GetHashCode() 返回此 VolumeNameCollection 的哈希码。(Overrides Object.GetHashCode().)
VolumeSnapshotInfo (namesapce Replay.Common.Contracts.Transfer)
下表显示 VolumeSnapshotInfo 参数可用的对象。
表. 315: VolumeSnapshotInfo 参数的对象
方法 说明
public Uri BlockHashesUri { get; set;} 获取或设置可用于读取卷数据块的 MD5 哈希值的 URI。
public Uri BlockDataUri { get; set;} 获取或设置可用于读取卷数据块的 URI。
VolumeSnapshotInfoDictionary (namespace
Replay.Common.Contracts.Transfer)
从参数 System.Collections.Generic.Dictionary<VolumeName, VolumeSnapshotInfo> 继承其值。
示例 PowerShell 脚本
以下示例脚本旨在帮助具有管理权限的用户运行 PowerShell 脚本。
PreTransferScript.ps1
PreTransferScript 在传输快照前于受保护机器上运行。
示例 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 = $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
}
402 使用脚本扩展 Rapid Recovery 作业










