How to use Get-IshEvent to return more than just Recent Publishing events

Hi,

I'm new to ISHRemote coding, but I developed the following code to try to return all publishing events that occurred in the last 30 days ...

Instead that returns "RECENT" publish event information. I'm looking for what I need to do to get IshRemote to return "ALL" publish events (as if I went into the Web Client Event Log and clicked the "Show All" button instead of the "Show Recent" button. This code (below) gives me the list as if I clicked the "Show Recent" button and I can't figure out how to extend the list. 

Thanks for whatever assistance you can provide. 

..

$ishSession = $ishSession_dev
$is = New-IshSession -WsBaseUrl $ishSession

Write-output "Collecting publishing information ..."
$sinceWhen = (Get-Date).AddDays(-30).ToString("dd/MM/yyyy HH:mm:ss")

$requestedMetadata = Set-IshRequestedMetadataField -IshSession $is -Name "USERID" -Level "Progress" |
Set-IshRequestedMetadataField -IshSession $is -Name "EVENTTYPE" -Level "Progress" |
Set-IshRequestedMetadataField -IshSession $is -Name "CREATIONDATE" -Level "Progress" |
Set-IshRequestedMetadataField -IshSession $is -Name "MODIFICATIONDATE" -Level "Progress"
Set-IshRequestedMetadataField -IshSession $is -Name "DESCRIPTION" -Level "Progress" |
Set-IshRequestedMetadataField -IshSession $is -Name "STATUS" -Level "Progress"
$metadataFilter = Set-IshMetadataFilterField -IshSession $is -Name "MODIFICATIONDATE" -Level "Progress" -FilterOperator GreaterThan -Value $sinceWhen
Set-IshMetadataFilterField -IshSession $is -Name "ACTION" -Level "Detail" -FilterOperator In -Value "Execution completed"
$publish =Get-IshEvent -IshSession $is -RequestedMetadata $requestedMetadata -MetadataFilter $metadataFilter |
ConvertTo-Csv

Parents
  • Hi Tom,

    In this case, it is simpler, there is a -ModifiedSince parameter shortcut :-)

    Try the below one-liner. Actually since ISHRemote v0.7 there is an implicit selection of metadata and all returned objects get enriched with read-only PSNoteProperties for easy rendering across all cmdlets. See also https://github.com/sdl/ISHRemote/blob/master/Doc/ReleaseNotes-ISHRemote-0.7.md describing that for the Find-IshDocumentObj cmdlet but works for Get-IshEvent as well.

    Get-IshEvent -ModifiedSince (Get-Date).AddDays(-30).ToString("dd/MM/yyyy HH:mm:ss")

    Be aware that there is a database job that cleans up this database-centralized background task logging. So you cannot go indefinitely back in time on logging.

    -Dave

    PS: in your above sample code it looks like there is a pipe (|) continuation missing between the 1st and 2nd Set-IshMetadataFilterField which in turn could mean you are missing a filter

Reply
  • Hi Tom,

    In this case, it is simpler, there is a -ModifiedSince parameter shortcut :-)

    Try the below one-liner. Actually since ISHRemote v0.7 there is an implicit selection of metadata and all returned objects get enriched with read-only PSNoteProperties for easy rendering across all cmdlets. See also https://github.com/sdl/ISHRemote/blob/master/Doc/ReleaseNotes-ISHRemote-0.7.md describing that for the Find-IshDocumentObj cmdlet but works for Get-IshEvent as well.

    Get-IshEvent -ModifiedSince (Get-Date).AddDays(-30).ToString("dd/MM/yyyy HH:mm:ss")

    Be aware that there is a database job that cleans up this database-centralized background task logging. So you cannot go indefinitely back in time on logging.

    -Dave

    PS: in your above sample code it looks like there is a pipe (|) continuation missing between the 1st and 2nd Set-IshMetadataFilterField which in turn could mean you are missing a filter

Children