ExportMethods.ps1
# # Citrix IPS export job support # function Set-SmbOutputLocation([hashtable]$Parameters, [hashtable]$JobData, [string]$SmbSectionName=$Null, [psobject]$ConfigData=$Null, [bool]$Verbose=$False) { $JobData['outputStorageLocation'] = @{ Location = Get-SmbLocation -ConfigData $ConfigData -Parameters $Parameters -SmbConfigNode $SmbSectionName -Verbose $Verbose credentialId = Get-SmbParameter -ConfigData $ConfigData -Parameters $Parameters -SmbConfigNode $SmbSectionName -ParameterName 'SmbCwId' -ConfigParameterName 'CwId' -Verbose $Verbose } } function Format-ExportData([string]$Platform, [hashtable]$Parameters, [psobject]$ConfigData=$Null, [bool]$Verbose=$False) { if ($ConfigData) { $cloudPlatform = Test-IsCloudPlatform $Platform if ($cloudPlatform -And $ConfigData.psobject.Properties.name -contains "PublishSmb") { $SmbSectionName = 'PublishSmb' } else { $SmbSectionName = 'ExportSmb' } if ($cloudPlatform) { $JobResourceLocationIdName = 'PublishResourceLocationId' } else { $JobResourceLocationIdName = 'ExportResourceLocationId' } } $exportData = Format-JobData -Platform $Platform -ConfigData $ConfigData -Parameters $Parameters -JobResourceLocationIdName $JobResourceLocationIdName -Verbose $Verbose Set-SmbOutputLocation -ConfigData $ConfigData -Parameters $Parameters -JobData $exportData -SmbSectionName $SmbSectionName -Verbose $Verbose $exportData['outputImageFilename'] = Get-SmbParameter -ConfigData $ConfigData -Parameters $Parameters -SmbConfigNode $SmbSectionName -ParameterName 'SmbDiskName' -ConfigParameterName 'DiskName' -Verbose $Verbose $exportData['outputImageFormat'] = Get-SmbParameter -ConfigData $ConfigData -Parameters $Parameters -SmbConfigNode $SmbSectionName -ParameterName 'SmbDiskFormat' -ConfigParameterName 'DiskFormat' -Verbose $Verbose $exportData['provisionType'] = "Thin" $exportData['hashDisk'] = $Parameters.Contains('HashDisk') -And $Parameters.HashDisk return $exportData } |