I have a Powershell script which calls an XML, gets a URL, and tries to open Chrome to that URL. Downside, the URL contains the = character, and none of the character escape suggestions I've seen work.
Here's the XML:
<Config>
<Stuff>
<Application Name="Place" CaptivePortal="https://website.com:1337/php/uid.php?thing=1&stuff=0" RDP="192.168.1.1" Entitlement="Admin" />
</Stuff>
</Config>
And here's the section of the PS scripts that's calling it:
Function func_launch_Stuff($v_func_parm_launch_type, $v_func_parm_launch_element){
# launch based on type
switch ($v_func_parm_launch_type)
{
"URL" {
$v_Application_Launch = "C:\Program Files\Google\Chrome\Application\chrome.exe"
$v_Application_Argument = "$($v_func_parm_launch_element)"
Start-Process -FilePath $v_Application_Launch -ArgumentList $v_Application_Argument -Wait}
}
}
[xml]$v_XML_Config_File = Get-Content -Path $v_parm_XML_Config_File
I've trimmed out other sections, because this is the only one throwing errors. I'd go into changing the original script more, but it was hand crafted by an engineer we don't have anymore, and I'm not good enough with PS to redo this myself in a way that'll handle my issue without making 10 more.
I've tried using the four options from here, and manually replacing the = character with =. It always throws the error below, with X replaced by =, `=, or &.
"Error message: Cannot convert value "System.Object[]" to type "System.Xml.XmlDocument". Error: "'X' is an unexpected token."