if($ExportJobRequestObject -eq $null) {echo 'ExportJobRequestObject parameter is null'}else {echo 'VolumeImageIds:' $ExportJobRequestObject.VolumeImageIdsecho 'RamInMegabytes:' $ExportJobRequestObject.RamInMegabytes}Prenightlyjobscript.ps1The PreNightlyJobScript is executed before every nighty job on Core side. It has $JobClassName parameter, that helpsto handle those child jobs separately.# receiving parameters from Nightlyjobparam([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# Nightlyjob has four child jobs: NightlyAttachability Job, Rollup Job,Checksum Check Job and Log Truncation Job. All of them are triggering thescript, and $JobClassMethod (contain job name that calls the script) helps tohandle those child jobs separatelyswitch ($JobClassMethod) {# working with NightlyAttachability JobNightlyAttachabilityJob {$NightlyAttachabilityJobRequestObject =$NightlyAttachabilityJobRequest -as[Replay.Core.Contracts.Sql.NightlyAttachabilityJobRequest];echo 'Nightly Attachability job results:';if($NightlyAttachabilityJobRequestObject -eq $null) {echo 'NightlyAttachabilityJobRequestObject parameter isnull';}else {echo 'AgentId:'$NightlyAttachabilityJobRequestObject.AgentId;echo 'IsNightlyJob:'$NightlyAttachabilityJobRequestObject.IsNightlyJob;}break;}# working with Rollup JobRollupJob {$RollupJobRequestObject = $RollupJobRequest -as[Replay.Core.Contracts.Rollup.RollupJobRequest];echo 'Rollup job results:';if($RollupJobRequestObject -eq $null) {158