AnsweredAssumed Answered

Powershell where clause data format and export

Question asked by wpurrer on Nov 4, 2016
Latest reply on Nov 4, 2016 by pthivierge

Hello everyone 2 Poweshell questions

 

1.) how can i filter  for PI Points with a changedata


$conn
= Connect-PIDataArchive -PIDataArchiveMachineName $servername

# $tag = Get-PIPoint -Name sin* -Attributes tag,recno,pointid,pointsource,ptsecurity,datasecurity -Connection $conn#

# $tag = Get-PIPoint -Name sin* -AllAttributes  -Connection $conn

$tag = Get-PIPoint -Where 'changedate:>1.11.2016' -AllAttributes  -Connection $conn


this doesn't work (the format of the date is the local format) => i get points back where the change date is older)

PS C:\Users\lagpuwadm> $tag[1].Attributes

 

Key                                                                                             Value                                                                                        

 

---                                                                                             -----                                                                                        

 

descriptor                                                                                     yyyyyy

exdesc                                                                                                                                                                                       

 

typicalvalue                                                                                    50                                                                                           

 

engunits                                                                                                                                                                                     

 

zero                                                                                            0                                                                                            

 

span                                                                                            100                                                                                          

 

pointtype                                                                                       String                                                                                       

 

pointsource                                                                                     PINotifications-InternalUse                                                                  

 

scan                                                                                            1                                                                                            

 

excmin                                                                                          0                                                                                            

 

excmax                                                                                          0                                                                                            

 

excdev                                                                                          0                                                                                            

 

shutdown                                                                                        0                                                                                            

 

archiving                                                                                       1                                                                                            

 

compressing                                                                                     0                                                                                            

 

step                                                                                            1                                                                                            

 

compmin                                                                                         0                                                                                            

 

compmax                                                                                         28800                                                                                        

 

compdev                                                                                         0                                                                                            

 

creationdate                                                                                    17.03.2016 13:22:50                                                                          

 

creator                                                                                         piadmin                                                                                      

 

changedate                                                                                      17.03.2016 13:22:50                                                                          

 

changer                                                                                         piadmin                                                                                      

 

displaydigits                                                                                   -5                                

 

 

 

2.) how can i export in a format (which can be later used for reimport through the PI Builder)

(i want to get regular exports of the configuration so in the case of an issue it can be easier tracked what has changed ... PI Audit is a nightmare)

 

Outcomes