When trying to tokenize a XML file with UTF-16 encoding. I'm getting this error:
System.Management.Automation.ParameterBindingValidationException: Cannot validate argument on parameter 'Encoding'. The argument "Unicode UTF-16 Little-Endian" does not belong to the set "unknown,string,unicode,bigendianunicode,utf8,utf7,utf32,ascii,default,oem" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again. ---> System.Management.Automation.ValidationMetadataException: The argument "Unicode UTF-16 Little-Endian" does not belong to the set "unknown,string,unicode,bigendianunicode,utf8,utf7,utf32,ascii,default,oem" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.
I'm using a XML like this one:
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<!-- ... -->
<Triggers>
<EventTrigger>
<Enabled>true</Enabled>
<Subscription><QueryList><Query Id="0" Path="Microsoft-Windows-NetworkProfile/Operational"><Select Path="Microsoft-Windows-NetworkProfile/Operational">*[System[Provider[@Name='NetworkProfile'] and EventID=10000]]</Select></Query></QueryList></Subscription>
</EventTrigger>
</Triggers>
<!-- ... -->
</Task>
When trying to tokenize a XML file with UTF-16 encoding. I'm getting this error:
System.Management.Automation.ParameterBindingValidationException: Cannot validate argument on parameter 'Encoding'. The argument "Unicode UTF-16 Little-Endian" does not belong to the set "unknown,string,unicode,bigendianunicode,utf8,utf7,utf32,ascii,default,oem" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again. ---> System.Management.Automation.ValidationMetadataException: The argument "Unicode UTF-16 Little-Endian" does not belong to the set "unknown,string,unicode,bigendianunicode,utf8,utf7,utf32,ascii,default,oem" specified by the ValidateSet attribute. Supply an argument that is in the set and then try the command again.I'm using a XML like this one: