That is most probably due to the MaxSamples parameter.
Try changing this line
$eventNr = 9999
into this
$eventNr = [int]::MaxValue
That is most probably due to the MaxSamples parameter.
Try changing this line
$eventNr = 9999
into this
$eventNr = [int]::MaxValue