Cannot process argument transformation on parameter ‘VARName’.

During one of my adventures into the world of PowerShell I came across the following error: Cannot process argument transformation on parameter ‘Environment’. Cannot convert value “System.Xml.XmlElement” to type “System.Xml.XmlDocument”. … read the powershell-cannot-process-argument-transformation-on-parameter-varname post