AnsweredAssumed Answered

Delete tag values for a given time range using PowerShell

Question asked by ChristerLindquist on Jul 24, 2020

Hi,

I am trying to delete archived values for a PI Tag that was incorrectly backfilled, using PowerShell. On my previous attempts I have been using this script in a test environment:

 

$con = Connect-PIDataArchive -PIDataArchiveConnectionConfiguration (Get-PIDataArchiveConnectionConfiguration -name  PI Server name) $pt = Get-PIPoint -Name tagname -Connection $con Remove-PIValue -Connection $con -Event (Get-PIValue -PointName $pt -StartTime "24-Jul-2020 14:40:00" -EndTime "24-Jul-2020 15:15:00")

 

I am getting this error:

I have also tried using PIPoint instead of PointName under Get-PIValue -PIPoint $pt:

PowerShell verison:

Outcomes