I'm trying to create a simple powershell cmdlet that would have a few mandatory parameters. I've found the following code for doing so however, I cannot get it to execute:
function new-command() {
[CmdletBinding()]
PARAM (
[Parameter(Mandatory=$true)]
[string]$Name
)
}
new-command
Returns the following error:
Missing closing ')' in expression." Line: 5 Char: 3 + [ <<<< string]$Name
What am I doing wrong?