Error Passing Several ambiguous overloads found for Save,

I am trying to save an xml object using save method. I get an error message:

Several ambiguous overloads found for "Save" and the number of arguments: "1".

Function Save-File($config, $fileLocation){
    #saves to file
    $config.Save($fileLocation)       
}

I know that by running only one, the program will work without errors. Therefore, I believe that multiple method calls cause a problem, but I am not familiar with the argument.

What can I do to calm the Powershell console, it works in Powershell ISE, but I'm not sure where to look now.

Thanks for reading. Please let me know if you have any questions and I will do my best to provide the correct information.

+4
1

$fileLocation , .

function Save($config,[string]$fileLocation) 
{ 
 $config.Save($fileLocation) 
}
+3

Source: https://habr.com/ru/post/1625529/


All Articles