Parameterattribute default value (C# cmdlet) in PowerShell
With auto-implemented properties, you can't. You will need to create the actual getter and setter.
Something like this:
private string _ParameterName = "defaultvalue";
[Parameter]
public string ParameterName
{
get
{
return _ParameterName ;
}
set
{
_ParameterName = value;
}
}
Since C# 6.0 has been released:
[Parameter]
public string ParameterName { get; set; } = "defaultValue";