Page History
...
-HistoryId <String>
Specifies the history ID that the order was running for. This information is provided by the
Get-JobSchedulerOrderHistory JS7OrderHistory cmdlet.
Required? | false |
Position? | 1 |
Default value | |
Accept pipeline input? | true (ByValue, ByPropertyName) |
Accept wildcard characters? | false |
...
-OrderId <String>
This parameter specifies the order ID that was running for the given history ID.
...
WorkflowPath
-WorkflowPath <String>
This parameter specifies the workflow path and name that the order is assigned.
Required? | false |
Position? | 3 |
Default value | |
Accept pipeline input? | true (ByValue, ByPropertyName) |
Accept wildcard characters? | false |
...
PS > Get-JS7OrderHistory -Workflow WorkflowPath /product_demo/shell_chain | Get-JobSchedulerOrderLogJS7OrderLog
Retrieves the most recent order log for the given workflow.
...
PS > Get-JS7OrderHistory -Workflow WorkflowPath /product_demo/shell_chain | Get-JobSchedulerOrderLog JS7OrderLog | Out-File /tmp/shell_chain.log -Encoding Unicode
...
PS > Get-JS7OrderHistory -RelativeDateFrom -8h | Get-JobSchedulerOrderLog JS7OrderLog | Select-Object @{name='path'; expression={ "/tmp/history/$(Get-Date $_.startTime -f 'yyyyMMdd-hhmmss')-$([io.path]::GetFileNameWithoutExtension($_.workflow))-$($_.orderId).log"}}, @{name='value'; expression={ $_.log }} | Set-Content
...
PS > # execute once $lastHistory = Get-JobSchedulerOrderHistory JS7OrderHistory -RelativeDateFrom -8h | Sort-Object -Property startTime # execute by interval Get-JS7OrderHistory -DateFrom $lastHistory[0].startTime | Tee-Object -Variable lastHistory | Get-JobSchedulerOrderLog JS7OrderLog | Select-Object @{name='path'; expression={ "/tmp/history/$(Get-Date $_.startTime -f 'yyyyMMdd-hhmmss')-$([io.path]::GetFileNameWithoutExtension($_.workflow))-$($_.orderId).log"}}, @{name='value'; expression={ $_.log }} | Set-Content
Provides a mechanism to subsequently retrieve previous logs. Starting from initial execution of the Get-JobSchedulerOrderHistory JS7OrderHistory cmdlet the resulting $lastHistory object is used for any subsequent calls. Consider use of the Tee-Object cmdlet in the pipeline that updates the $lastHistory object that can be used for later executions of the same pipeline. The pipeline can e.g. be executed in a cyclic job.