You can only start the wizard from the BlueParq Designer.
BlueParq Designer
- Press the right mouse button, the BlueParq Radial Menu will present itself.
- Press the Add variable button
Create a variable first
- In order to work with the condition wizard, you first have to create a variable assignment.
- The fastest way is to click on the sign of the Variables node.
- Create a string, just like the example below.
- Press Save to add the variable.
- Now add another variable:
- Name: StringHello
- Data type: string
- Default value: Hello
- Press Save to add the variable.
The variable wizard
- After opening the wizard the following screen will be displayed:
Trick: enter a new variable name
And the variable will get created for you.
Comments are great for documenting your PowerShell scripts!
The comments you create on several places will automatically be added to your annotations.
- As you can see in the above screen you have a couple options to manipulate your variable. In this example we will keep it simple and just assign a value to our empty string variable.
- Select the drop down menu of Variable and choose the created variable, in our example: StringHelloWorld.
- Press Assign value to variable.
- Press Next.
- As you can see in the above screen you have a couple options to assign something to your variable:
- Literal value: just add a string or number to your variable.
- Variable: add another variable to your variable.
- Regex: manipulate your variable with Regex (a good site to start: http://regexstorm.net/tester).
- Null: make the variable Null.
- External: this option lets you connect an external block to the variable, for example a cmdlet.
Literal value
- In this example, we will keep it simple and just assign a value to our empty string variable.
- Select the drop-down menu of Variable and choose the created variable, in our example: StringHelloWorld.
- Press Assign value to a variable.
- Press Next.
- Add Hello World, just like the example below, by clicking on the literal value link you can add more Literal values.
- Click Finish and the block will be created.
Variable
- In this example, we add another variable to our variable.
- Select the drop-down menu of Variable and choose the created variable, in our example: StringHelloWorld.
- Press Assign value to a variable.
- Press Next.
- Click on the Literal value link option and select Variable.
- Choose the variable $StringHello
- Add World, just like the example below, by clicking on theyou can add more Literal values.
- Click Finish and the block will be created.
External
- In this example, we will add an external block to our variable.
- Select the drop-down menu of Variable and choose the created variable, in our example: StringHelloWorld.
- Press Assign value to a variable.
- Press Next.
- Click on the Literal value link option and select External.
- Click Finish and the block will be created.
Result in the BlueParq Designer
We will use our Hello world example in the External option.
- If we generate the diagram we will get the following result:
- Nice! But not very spectacular. As our variable has a default empty value, it will stay empty.
- Let's just show change the variable content to Hello World and output the variable content to the screen. First of all right mouse click on the Group Element, the BlueParq Radial Menu will appear.
- Press the Add variable button
- In this example, we will keep it simple and just assign a value to our empty string variable.
- Select the drop-down menu of Variable and choose the created variable, in our example: StringHelloWorld.
- Press Assign value to a variable.
- Press Next.
- Add Hello World, just like the example below, by clicking on the button you can add more Literal values.
- Click Finish and the block will be created.
- Now press on the orange doton the last block. The orange dot will turn green
- Right mouse click somewhere on the canvas, the BlueParq Radial Menu will appear.
- Press the cmdlet wizard and press Echo in the search field. Also checkout the cmdlet wizard tutorial here.
- Press Echo under Alias and press Next.
- Make sure you add $StringHelloWorld in the InputObject text box.
- Press Finish and the cmdlet block will be added within the Group Element.
Result in the BlueParq Editor
[System.String] $StringHelloWorld
[System.String] $StringHello = 'Hello'
$StringHelloWorld = $StringHelloWorld = $StringHello + " " + "World"
Microsoft.PowerShell.Utility\Write-Output -InputObject $StringHelloWorld