Command Naming Reference

GENESIS PowerShell commands follow a small, consistent set of naming patterns. Because the same patterns apply to every provider, you can derive almost any command name from a verb and an entity rather than looking it up. This topic documents those patterns and the special-purpose commands that fall outside them. For the concepts behind entities and keys, see Entities, Keys, and the Command Model; to find which module a command belongs to, see the PowerShell Module Reference.

Entity Command Pattern

Most commands take the form Verb-PrefixEntity, where the verb is one of four standard actions, the prefix identifies the provider module, and the entity is the configurable item. For example, New-AcEquipment is New + Ac (Assets) + Equipment.

Verb

Purpose

Example

Get

Reads an entity, all entities of a type, or the children of a parent.

Get-AcEquipment 'Baking line'

New

Creates a new entity.

New-AcEquipment -Name 'Press01'

Set

Updates an existing entity; only the supplied parameters change.

Set-AcEquipment 'Press01' -Enabled $true

Remove

Deletes an entity.

Remove-AcEquipment 'Press01'

Get Forms

The Get verb has three forms for every entity type:

Form

Returns

Example

Get-PrefixEntity <name>

The single entity you identify by name, key, or identifier.

Get-TrgDataItem 'HighTemp'

Get-PrefixEntitys

Every entity of the specified type.

Get-TrgDataItems

Get-PrefixEntitysByParent <parent>

The children of the specified parent entity.

Get-AcEquipmentsByParent 'Line A'

The plural is formed by appending s to the entity name as the command set defines it, which is why some commands read as ...Items (Get-TrgDataItems) and others as ...es or irregular plurals. Use Get-Command to confirm the exact spelling for a given entity. Learn more

Common Entity Parameters

Most New and Set commands accept the following parameters in addition to the entity-specific ones:

Parameter

Notes

-Name

The entity to act on, identified by a name, key, or identifier. Mandatory and positional (position 0) on single-entity commands.

-ParentName

The parent entity, identified by a name, key, or identifier. Omit to create at the provider's root. Default: (null)—root.

-Description

Free-text description. Default: (null).

-NewName

On Set commands, renames the entity. Default: (null)—name unchanged.

Special Commands

Some commands sit outside the entity pattern and provide cross-cutting capabilities. These come from the IcoWorkbenchPowershell and IcoConfigPowershell modules.

Targeting a host

Command

Purpose

Get-WbHost

Reports the host whose configuration the session is currently changing.

Set-WbHost <computer>

Retargets the session to a different Workbench host. Every subsequent command applies there.

Examples:

Get-WbHost Set-WbHost SERVER02

Building keys

Keys reference an entity without loading it. Learn more

Command

Purpose

New-WbKey -TypeName <type> -Id <id>

Builds a key from an entity type name and database identifier.

New-WbEmptyKey

Creates an empty key that is used where the command requires a key placeholder.

New-WbRootKey

Creates a key that refers to a provider's root.

New-WbType -TypeName <type>

Creates a type reference.

Examples:

$aliasKey = New-WbKey -TypeName GasAlias -Id 2 Get-GasAlias $aliasKey

Configuration and helpers

Command

Purpose

Export-WbConfiguration

Exports configuration from the current host.

Import-WbConfiguration

Imports configuration into the current host.

Set-WbMultiply

Bulk-duplicates the configuration.

Get-Guid

Generates a GUID for parameters that require one.

Set-WbBackupDatabase / Get-WbRestorePoints

Backs up a configuration database and lists available restore points.

Worked Example

The following example uses the patterns together: it builds a key for a collector group, reads a logging group's key, and passes both into a New command to create a Data Historian tag.

$collectorKey = (Get-HHCollectorGroup 'Collector Group (1 second)').Key $loggingKey = (Get-HHLoggingGroup 'Sample Logging Group').Key New-HHTag -Name Sine -CollectorGroupID $collectorKey -LoggingGroupID $loggingKey -DataSource 'svrsim:sine double med -100 100'

Related Topics: