AnsweredAssumed Answered

Powershell Script Issue

Question asked by PIOhMY on Sep 23, 2020
Latest reply on Sep 29, 2020 by James Devine

Hi , 

I have written a ps script that deletes all events between 2 dates. Its works for the majority of tags ,except for a handful . I have also checked that events exist between the 2 dates specified for the tags that im having an issue with.Im not sure why it would work for some and not others.




$con = Connect-PIDataArchive -PIDataArchiveMachineName "PISRV1"
$pt = Get-PIPoint -Name mytestTag $con
Remove-PIValue -Event (Get-PIValue -PIPoint $pt -StartTime "01-Jan-2020 12:00:00" -EndTime "16-Sep-2020 19:30:00") -Connection $con

The error i get:


PS version;

Any help or pointers would be great to hear.