I'm designing a cmdlet using plain C#. Is it possible to define a default value for a parameter?

Script cmdlet:

[Parameter] [string] $ParameterName = "defaultValue"

Which is the equivalent for C#?

[Parameter]
public string ParameterName { get; set; }

没有正确的解决方案

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top