Guidelines for comments
Contributors
Suggest changes
You must be aware of the guidelines for PowerShell and Perl comments in your scripts for OnCommand Workflow Automation (WFA).
PowerShell comments
Guidelines | Example |
---|---|
Use the # character for a single line comment. |
# Single line comment $options=$option.trim(); |
Use the # character for an end of line comment. |
$options=$option.trim(); # End of line comment |
Use the <# and #> characters for a block comment. |
<# This is a block comment #> $options=$option.trim(); |
Perl comments
Guidelines | Example |
---|---|
Use the # character for single line comment. |
# convert from MBytes to Bytes my $MaxDirectorySizeBytes = $MaxDirectorySize * 1024 * 1024; |
Use the # character for end of line comment. |
my $MaxDirectorySizeBytes = $MaxDirect orySiZe * 1024 * 1024; # convert to Bytes |
Use the # character in every line with an empty # at the beginning and end to create a comment border for multi-line comments. |
# # This is a multi-line comment. Perl 5, unlike # Powershell, does not have direct support for # multi-line comments. Please use a '#'in every line # with an empty '#' at the beginning and end to create # a comment border # |
Do not include commented and dead code in WFA commands. However, for testing purposes, you can use the Plain Old Documentation (POD) mechanism to comment out the code. |
=begin comment # Set deduplication if(defined $Deduplication && $Deduplication eq "enabled") { $wfaUtil->sendLog("Enabling Deduplication"); } =end comment =cut |