Question:
I am trying to save an xml object using the save method. I receive the error:
Multiple ambiguous overloads found for “Save” and the argument count:
“1”.
1 2 3 4 5 |
Function Save-File($config, $fileLocation){ #saves to file $config.Save($fileLocation) } |
I know that by running only one save the program runs without error. So I believe the multiple calls of the method are causing the issue but I am not familiar with argument.
What can I do to placate the Powershell console, it was running in Powershell ISE but I am not sure where to look now.
Thanks for the read. Please let me know if you have any questions and I will do my best to provide the correct info.
Answer:
Define the parameter $fileLocation as a string, so which Save overload to call is not ambiguous.
1 2 3 4 5 |
function Save($config,[string]$fileLocation) { $config.Save($fileLocation) } |