AnsweredAssumed Answered

Add Element with PI Powershell

Question asked by PedroCampos on Oct 11, 2019
Latest reply on Oct 15, 2019 by sraposo

Hello everyone!


I am trying to create a Element with PI Powershell and on Powershell enviroment the element is created but it do not appears on PI System Explorer.

This is my code:


$afServer = Get-AFServer -Name "<AFServer>"

$afDatabase = Get-AFDatabase -Name "<AFDatabase>" -AFServer $afServer

$afElement = Get-AFElement -Name "PI Server" -AFDatabase $afDatabase
Add-AFElement -AFElement $afElement -Name "FL180" -AFElementTemplate (Get-AFElementTemplate -Name "Site-Server" -AFDatabase $afDatabase) -CheckIn
$afElementCreatedServer = Get-AFElement -AFElement $afElement -Name "FL180"


I am using PI System 2018


I have created "Site-Server1" element child of "PI Server" on PI System Explorer. Comparing the get "PI Server" and get "FL180-HP206" on Powershell and the only difference is:

Parents               : {PI Server} -> on "Site-Server1" (Created with PI System Explorer)

Parents               : {} -> on "FL180" (Created with PI Powershell)