You should first create the timeRange with your startTime and endTime:
$timeRange = New-Object OSIsoft.AF.Time.AFTimeRange($startTime, $endTime)
and then pass it to RecordedValues:
$piPoint.RecordedValues($timeRange, [OSIsoft.AF.Data.AFBoundaryType]::Inside, $null, $false)