AnsweredAssumed Answered

Renaming a PI tag in PowerShell

Question asked by on Apr 22, 2019
Latest reply on Apr 23, 2019 by John Messinger

I'm working in Powershell trying to use Set-PIPoint to configure PI tags. I need to rename a tag but running into this error:


Set-PIPoint : [-10567] Point ID does not match Tag or Tag rename to same name

At C:\itad\SST\PiConfiguration\In Progress\Rename-BigBend-Tags.ps1:32 char:1

+ Set-PIPoint -Connection $con -Name B_BACKWASH_FLOW_TOTAL -Attributes  ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidOperation: (Address: pi://h...vices | PIWorld:ClientChannel) [Set-PIPoint], PIArgumentException

    + FullyQualifiedErrorId : SetPIPoint,OSIsoft.PowerShell.SetPIPoint


when I try:


Set-PIPoint -Connection $con -Name B_BACKWASH_FLOW_TOTAL -Attributes @{tag="BW_FLOW_DAILY_VOLUME"}


I want to think it's just a matter of using the right attribute name (something link newtag, or tag_rename) but so far I have not found the right one.


Does anyone know how to use PowerShell to rename PI tags?


BTW, we are moving into a DevOps way of managing our servers and need to find ways to script changes. We were using SQL and the old mypisql tool to do the work, but now we are tightening security and are no longer able to do explicit logins (thus mypisql is out). I guess piconfig is another way to go. I'm open to suggestions.