Method invocation failed because [System.Management.Automation.ErrorRecord] does not contain a method named 'Replace'. Method invocation failed because [System.Management.Automation.ErrorRecord] does not contain a method named 'Replace'. Method invocation failed because [System.Management.Automation.ErrorRecord] does not contain a method named 'Replace'. Cannot overwrite variable Error because it is read-only or constant.