VMware VCENTER CONFIGURATION MANAGER 5.3 - SOFTWARE CONTENT REPOSITORY TOOL GUIDE Podręcznik Użytkownika Strona 230

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 254
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 229
230 | Scripting
PostExportScript.ps1
The PostExportScript is executed on the Core side after any export job.
NOTE: There are no input parameters for the PostExportScript when used to
execute once on the exported agent after initial startup. The regular agent 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\Ap
pRecovery 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
}
Przeglądanie stron 229
1 2 ... 225 226 227 228 229 230 231 232 233 234 235 ... 253 254

Komentarze do niniejszej Instrukcji

Brak uwag