AnsweredAssumed Answered

Gather All Elements by Element Template Using PowerShell?

Question asked by James Devine on Sep 27, 2017
Latest reply on Sep 29, 2017 by James Devine

Is there a way, using PowerShell, to gather all the elements in an AF Database that were made using a named template?

 

Here is the line of code I am trying:

$afElements = Get-AFElement -Template $afElementTemplate -AFDatabase $afDatabase

 

Note: after the 'Get-AFElement' when I type the '-' symbol  IntelliSense does not show 'Template' as an option. This bit of script throws an error. I fear this feature does not exist in the OSIsoft PowerShell library. I prefer to avoid embedded loops with repeat functions to dig through the whole AF database to find those elements generated using a target template.

Outcomes