AnsweredAssumed Answered

Powershell cmdlets,

Question asked by HansBleijendaal on Nov 2, 2017
Latest reply on Nov 9, 2017 by gregor

I try to run powershell cmdlets, but I am struggling te get data.

 

I want to run the "Find-AFEventFrame" command to find particular eventframes.

Example: Filter on element, template, eventframe template etc...

 

So in the cmdlets I need to provide the correct parameters and that is the problem.

Which parameter to use and how?

 

The first cmd return data, the second cmd givers error, see below.

THe question is what parameter and how to use? What do I wrong?

How to use wildcards?

 

 

Find-AFEventFrame   -maxcount 10 -AFDatabase $afDB

tartTime                : 11/2/2017 9:32:01 AM

 

EndTime                  : 12/31/9999 11:59:59 PM

 

TimeRange                : 11/2/2017 9:32:01 AM - 12/31/9999 11:59:59 PM

 

Duration                 : 69970191h+27m+57s+850.998ms

 

IsNew                    : False

 

IsDirty                  : False

 

CheckOutInfo             :

 

Security                 : ReadWrite, Delete, Admin, ReadWriteData, Annotate

 

IsTemporary              : False

 

IsLocked                 : False

 

AreValuesCaptured        : False

 

HasChildEventFrames      : False

 

HasChildElements         : True

 

IsRoot                   : True

 

Parent                   :

 

Parents                  : {}

 

PrimaryReferencedElement : 730PM001Log

 

Analysis                 : 440-Koek persen

 

EventFrames              : {}

 

Severity                 : None

 

CanBeAcknowledged        : False

 

IsAcknowledged           : False

 

AcknowledgedBy           :

 

AcknowledgedDate         : 1/1/1970 12:00:00 AM

 

ReferencedElements       : {730PM001Log}

 

Name                     : 440-Koek persen 2017-11-02 09:32:01.149

 

Description              :

 

Database                 : CocoaMain

 

Template                 : EFPerserijSubCyclus

 

Type                     : None

 

DefaultAttribute         :

 

DefaultInputPort         :

 

DefaultOutputPort        :

 

DefaultUndirectedPort    :

 

IsAnnotated              : False

 

ExtendedProperties       : {}

 

CategoriesString         : Perserij Cyclus;

 

Categories               : {Perserij Cyclus}

 

Attributes               : {PersStatus, Teller, Duur, KoekSoort...}

 

Ports                    : {}

 

ID                       : 5c68c83a-5c61-421e-0000-00000097b85f

 

UniqueID                 : 5c68c83a-5c61-421e-0000-00000097b85f

 

PISystem                 : KOOG-DMZ-PIAF

 

IsDeleted                : False

 

Identity                 : EventFrame

 

CreationDate             : 11/2/2017 9:32:06 AM

 

ModifyDate               : 11/2/2017 9:32:06 AM

 

RevisionNumber           : 1

 

StartTime                : 11/2/2017 9:31:25 AM

 

EndTime                  : 12/31/9999 11:59:59 PM

 

TimeRange                : 11/2/2017 9:31:25 AM - 12/31/9999 11:59:59 PM

 

Duration                 : 69970191h+28m+33s+339.9964ms

 

IsNew                    : False

 

 

Find-AFEventFrame   -maxcount 10 -NameFilter 310-Open vulklep 2017-11-01 15:52:52.617 -AFDatabase $afDB Find-AFEventFrame   -maxcount 10 -NameFilter 310-Open vulklep 2017-11-01 15:52:52.617 -AFDatabase $afDB


Find-AFEventFrame : Cannot bind parameter 'AFSearchMode'. Cannot convert value "15:52:52.617" to type "OSIsoft.AF.Asset.AFSearchMode". Error: "Unable to match the

 

identifier name 15:52:52.617 to a valid enumerator name.  Specify one of the following enumerator names and try again: None, StartInclusive, EndInclusive, Inclusive,

 

Overlapped, InProgress"

 

At line:1 char:75

 

+  Find-AFEventFrame   -maxcount 10 -NameFilter 310-Open vulklep 2017-11-01 15:52: ...

 

+                                                                           ~~~~~~

 

    + CategoryInfo          : InvalidArgument: (:) [Find-AFEventFrame], ParameterBindingException

 

    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,OSIsoft.PowerShell.FindAFEventFrame

 

 

310-Open vulklep 2017-11-01 15:52:52.617 is the name of the eventframe....

 

 

 

 

Find-AFEventFrame   -maxcount 10 -NameFilter 730PM002Log -AFDatabase $afDB

Find-AFEventFrame : Parameter set cannot be resolved using the specified named parameters.

 

At line:1 char:2

 

+  Find-AFEventFrame   -maxcount 10 -NameFilter 730PM002Log -AFDatabase $afDB

 

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

 

    + CategoryInfo          : InvalidArgument: (:) [Find-AFEventFrame], ParameterBindingException

 

    + FullyQualifiedErrorId : AmbiguousParameterSet,OSIsoft.PowerShell.FindAFEventFrame

 

 

 

 

730PM002Log is the name of the element....

 

 

 

Outcomes