AnsweredAssumed Answered

I cannot call OSIsoft.AF.Time.AFTime from Powershell

Question asked by RicardoNunez on Jun 11, 2020
Latest reply on Jun 12, 2020 by RicardoNunez

Hi,

 

I’m not able to call some AF libraries from my PC using Powershell. I was able to do so a few months ago. As an example, I’m getting this:

 

PS C:\Users\Insideview> $StartTime = [OSIsoft.AF.Time.AFTime]::Parse("*-2h")

Unable to find type [OSIsoft.AF.Time.AFTime].

At line:1 char:14

+ $StartTime = [OSIsoft.AF.Time.AFTime]::Parse("*-2h")

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

    + CategoryInfo          : InvalidOperation: (OSIsoft.AF.Time.AFTime:TypeName) [], RuntimeException

    + FullyQualifiedErrorId : TypeNotFound

 

According to https://techsupport.osisoft.com/Documentation/PI-AF-SDK/Html/T_OSIsoft_AF_Time_AFTime.htm, it’s in the “OSIsoft.AFSDK.dll” file. I was able to find it in my “C:\Program Files (x86)\PIPC\AF\PublicAssemblies\4.0” folder.

 

Any clue how I can solve this issue?

 

Thanks!

 

Ricardo

Outcomes