Hi,

Apologies if this is simple however I'm having real difficulty extracting the maximum value for a given range in Powershell Tools.

My script uses:

$max2WeeksAgo = (Get-PIExpressionSummary -Times $times -Intervals 1 -SummaryType Maximum -Basis EventWeighted -Expression "'$tag'" -Connection $myPi).VALUES

Where $times = @("$searchStart","$searchEnd")

PS H:\> $times

01/03/2019 12:29:58

01/10/2019 12:29:58

It returns with "Maximum [-11057] Not Enough Values For Calculation(0% Good data)"

Can anyone please advise?

How many values do you have in the time range for the given PI point? It appears from the error message that there are less than 2 values in the timespan.