In PowerShell advanced functions, the [CmdletBinding()] attribute is used to add useful metadata, and ensure that the function acts like a compiled PowerShell cmdlet. Some of this useful information can be accessed using the $PSCmdlet automatic variable.
In PowerShell Workflow, the [CmdletBinding()] attribute can be declared in a workflow definition (without receiving an error), but using the $PSCmdlet inside the workflow yields the following error message:
At C:\Demo\Workflow - Demo 04.ps1:11 char:5
+ $PSCmdlet;
+ ~~~~~~~~~
The variable 'PSCmdlet' cannot be used in a script workflow.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : VariableNotSupportedInWorkflow
My question boils down to this: Is there any benefit to using the [CmdletBinding()] attribute on a PowerShell workflow?