Search K
Appearance
Appearance
Create a PowerShell Job to run a custom PowerShell script, typically used as a follow up Job via Run follow Up CAD Jobs and Run Follow Up PDF Jobs
$wsFile
: - Variable contains the Vault Web Service File object$vConn
: Variable contains the Vault Connection$jobParams
: Variable contains the Job ParametersAfter initial execution (without any thrown exceptions), refresh the Minute Creator Script editor to see the listing of custom MinuteView and MinuteCreator objects.
To aid with script debugging, Write-Host
writes content to the Jobs debug log, accessed via Minute Insights Job History or found on the Job Processor under C:\TEMP\TTGENERALLOGS
.
The below PowerShell script can be used for Minute Creator Job PowerShell demonstration.
# Example Creator Script
# The target file in Vault will have its property "Author" updated.
Write-Host "Example Write Host"
# Alternative methods to return the FileId
Write-Host $jobParams["FileId"]
Write-Host $jobParams.FileId
# List all cmdlets from the Tentech.VaultCreator module
Get-Command -Module Tentech.VaultCreator | ForEach-Object { Write-Host $_ }
try {
Update-VaultFileProps -FileId $jobParams["FileId"] -Properties @{ "Author" = "KarlH@Tentech.com.au" }
Write-Host "Properties Updated"
}
catch {
Write-Host "Properties failed to update"
}
Executing a Creator Job containing this script via Minute Controller Queue Jobs will result in the target file having its "Author" property updated.
The Job debug log is found under the Minute Insights Job History. The Write-Output
content is logged between:
###################################### SCRIPT ######################################
...
###################################### END SCRIPT ######################################
The below commandlets are available for use within the Minute Creator Job PowerShell script.