Step Definitions - Metadata
Here we will take a closer look at Step Definitions in PowerShell, to take your automation and scripting a bit further.
Step Definitions stored in DeployR in the database in JSON blobs. When you break down the JSON, and compare it to the Step in the console, it all makes pretty good sense. In Step Definitions, we basically dig down a few layers to find everything.
Get-DeployRMetadata -Type StepDefinition
Metadata Properties
id: DeployR Unique ID (GUID) created at the time of the item's creation.
Built in Items typically start their pre-assigned ids with 00000000
name: Friendly name of the item that is display in the console
description: optional field to include additional information
typeName: a property you can set to whatever you like, I try to use it for organization in autoamation
versions: this is a JSON blob that contains additional details about the individual version, of which there can be many per item. This will look different depending on the purpose of the item. See the detailed areas to dig in more.
versionCount: the count of versions associated with an item
createdDate: the date the item was orginally created in DeployR
lastModifiedDate: the date the item was last modified by a user or process
readOnly: [True / False] lets you know if you can modify the item. Built in items are set to True.
Versions Deeper Drive. This metadata is consistent amoung different content item purposes, however not all items are used, it depends on the purpose.
id: a unique GUID created for each version
stepDefinitionId: the GUID id of the parent content item.
versionNo: the version count in the content item
status: the current status of that version (In Development, Active, Deprecated)
description: an optional property that you can provide additional information
options: where the content WIM file resides in your DeployR Content folder
validators
createdDate: date the version was created
lastModifiedDate: date of the last modificiation to the version
Options Deeper Dive. This metadata will comprise all of the different options in the step
name: name of the option you're setting, completely custom string
if the option is for a script, use: scriptName
if the option is for a content item with your scripts, use: content
displayName: Friendly Name shown in console
description: a description of what is going on with this option, shows up in the "Hover Over"
defaultValue: the default value for the option, will be different based on the option type
type: type of option it is
Text
Large text
Boolean
Script
Content
Content list
Dropdown
Task sequence
contentItemPurpose: Filter for when using a content option
hidden: True/False, will this option be shown in console? Often scripts and related content items are set to hidden True, so they don't show up.
validations: is there a regex validation associated with the option?
dropdownOptions: drop down table info
Lets take a look at a step definition in PowerShell
$Steps = (Get-DeployRMetadata -Type StepDefinition | Where-Object {$_.id -notlike '0000*'})
$Steps | Select-Object -Last 1
($Steps | Select-Object -Last 1).versions

This step definition is for advanced formatting of a disk. Lets dig into the options:


This step definition has several types leveraged to assist the user in determing which options they want to leverage. It also is using a script: Format-Disk.ps1, which is located in the content item d819ff51-72a1-4e3c-bdf3-fcb69cf1bbab:1 . When this step is triggered in the task sequence, it knows to download that content item, and run the Format-Disk script, and apply the parameters set in the step. Lets look this step in the Console:

Now lets look at it after it's added to a task sequence:

For reference, here is a blank option when you're adding a new one into a definition.


Last updated