Line 2 in the script below generates -
\"Cannot convert value \"System.Object[]\" to type \"System.Xml.XmlDocument\". Error: \"\'→\', hexadecimal va
System.Management.Automation.ArgumentTransformationMetadataException
Here is a way to discover yourself the full type name of an Exception, the result here gives System.Management.Automation.ArgumentTransformationMetadataException as given by @Adrian Wright.
Clear-Host
try {
[xml]$xml = Get-Content "c:\Temp\1.cs" # line 2
}
catch {
# Discovering the full type name of an exception
Write-Host $_.Exception.gettype().fullName
Write-Host $_.Exception.message
}