I want to have the value for element RN (so, 20200121) (i found an example here and modified it)
file is located at d:\test.xml
I tried:
[xml] $xdoc = get-content “d:\test.xml”
$xdoc | Select-Xml “//RN.value” | % { $_.Node.InnerText } | select -Unique
Which fails with error
Select-Xml : Cannot validate argument on parameter 'Xml'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
At line:1 char:10
+ $xdoc | Select-Xml “//RN” | % { $_.Node.InnerText } | select ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Select-Xml], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.SelectXmlCommand
I also tried:
[xml] $xdoc = get-content “d:\test.xml”
$xdoc | Select-Xml “//RN.value” | % { $_.Node.InnerText } | select -Unique
which gives no error nor output