Skip to main content
OnCommand Workflow Automation 5.0
A newer release of this product is available.

Guidelines for indentation

Contributors

You must be aware of the guidelines for indentation when writing a PowerShell or Perl script for OnCommand Workflow Automation (WFA).

Guidelines Example

A tab is equal to four empty spaces.

Use tabs and braces to show the beginning and end of a block.

PowerShell script

if
($pair.length-ne 2)
{
throw "Got wrong input data"
}

Perl script

if
(defined $MaxDirectorySize)
{
# convert from MBytes to Bytes
my $MaxDirectorySizeBytes = $MaxDirectorySize *
1024 * 1024;
}

Add blank lines between sets of operations or chunks of code.

$options=$option.trim();
$pair=$option.split(" ");
Get-WFAlogger -Info -messages $("split options: "+
$Pair)