I have a PowerShell script that contains this at the top:
Param(
# [snip]
[string] [Parameter(Mandatory=$true)] $Server
)
In my VSTS Release definition, I added an Azure Powershell task calling the script, and passed the argument as:
-Server '$(ServerName)' [snip]
However, when I trigger a new Release, at the step for this script, I get this error:
##[error]A parameter cannot be found that matches parameter name 'Server'.
I verified in the log output that the server name is passed properly. I even copy/pasted the command logged, and after fixing paths, it ran locally with no problems.
Why is this happening, and how can I fix it?