I ran ren . *.xml to convert them to xml document to use in my script.
What's the source file content and how have you converted it to XML?
Just changing the file extension to XML won't change anything on the file content.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello,
When transferring files, they import with the file extension "FILE". I ran ren *.* *.xml to convert them to xml document to use in my script. I receive this error when I run the script. Is there an additional property that I need to change in order for it to be recognized as the proper node type.
Select-Xml : The file '\\[FILE PATH].xml' cannot be read: The specified node cannot be inserted as
the valid child of this node, because the specified node is the wrong type.
At C:\[FILE PATH].ps1:35 char:10
+ $ip = $(Select-Xml -Path $File_Path -XPath "//address[@addrtype=' ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (\\[FILE PATH].xml:String) [Select-Xml], ArgumentExcept
ion
+ FullyQualifiedErrorId : ProcessingFile,Microsoft.PowerShell.Commands.SelectXmlCommand
Select-Xml : The file '\\[FILE PATH].xml' cannot be read: The specified node cannot be inserted as
the valid child of this node, because the specified node is the wrong type.
At C:\[FILE PATH].ps1:36 char:11
+ ... $mac = $(Select-Xml -Path $File_Path -XPath "//address[@addrtype=' ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (\\GRYFSW301\Dat...2_NMAP_Scan.xml:String) [Select-Xml], ArgumentExcept
ion
+ FullyQualifiedErrorId : ProcessingFile,Microsoft.PowerShell.Commands.SelectXmlCommand
I ran ren . *.xml to convert them to xml document to use in my script.
What's the source file content and how have you converted it to XML?
Just changing the file extension to XML won't change anything on the file content.