Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Reads an order log for a given workflow, order Order ID and history History ID. This cmdlet is mostly used for pipelined input from the
Get-JS7OrderHistory cmdlet that allows to search the execution history of orders and
that returns history History IDs that are used by this cmdlet to retrieve the order's log output.

The following REST Web Service API resources are used:

* /order/log/download

...

-HistoryId <String>
Specifies the history History ID that the order was running for. This information is provided by the
Get-JS7OrderHistory cmdlet.

...

PS > Get-JS7OrderHistory -RelativeDateFrom -8h | Get-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

Read Reads the logs of orders that completed within the last 8 hours and writes the log output to individual files. The log file names are created from the start time, the workflow name and order Order ID.

-------------------------- EXAMPLE 4 --------------------------

PS > # execute once
$lastHistory = Get-JS7OrderHistory -RelativeDateFrom -8h | Sort-Object -Property startTime
# execute by intervalin intervals
Get-JS7OrderHistory -DateFrom $lastHistory[0].startTime | Tee-Object -Variable lastHistory | Get-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

...