call C# method from powershell without supplying optional arguments
问题 I have a c# method I am loading from a dll with optional string arguments that default to null . For example public void foo(string path, string new_name = null, bool save_now = true) { if(name == null) new_name = Path.GetFileNameWithoutExtension(path); ... if(save_now) Save(); } I want to call this from within a powershell script and not supply a value for new_name but one for save_now . As per this seemingly very similar question I have tried $default = [type]::Missing $obj.foo($path,