AnsweredAssumed Answered

How to delete bad values for number of tags using Power shell script.

Question asked by DivyaSV on Jan 10, 2018
Latest reply on Jan 16, 2018 by DivyaSV

Hi All,

 

I am trying to delete bad values for number of tags using power shell script.

Can anyone please help me with the script.

 

am trying below script.

 

$con=Connect-PIDataArchive -PIDataArchiveMachineName Pimachinename

Select-Object -Property TimeStamp, Value

Get-PIValue -PIPoint -AllAttributes $pt -StartTime "2-Jan-2018 10:47:00" -EndTime "3-Jan-2018 05:15:00" | where -Pointsource:=abc  | where-Object { ($_.Value.State -eq 307) -and ($_.Value.StateSet -eq 0) } |Select TimeStamp, Value

Remove-PIValue -Event (Get-PIValue -pointsource:=abc $pt -StartTime "2-Jan-2018 10:47:00" -EndTime "3-Jan-2018 05:15:00" | Where-Object { ($_.Value.State -eq 307) -and ($_.Value.StateSet -eq 0) }) -Connection $con

 

Regards,

Divya

Outcomes