I'm in trouble with my script.
I'm grabbing paths out of an XML-File, that need to be modified.
$file = [xml](Get-Content "PATH\TO\XML.xml")
$file.here.is.my.attribute | Format-Table -Wrap -AutoSize | out-file -filepath ".\PATHS.txt" -append
Powershell is inserting line-breaks in the middle of my path, because it's to long (Just read about buffersize). I tried to save it to an .XML File instead of an .TXT File but that didn't work for me.
Any Idea of a workaround?
File should look like this:
Path1\Path\Path\path
Path2\Path\Path\path
Path3\Path\Path\path
But it looks like:
Path1\Path\Path\
path
Path1\Path\Path\
path
Path1\Path\Path\
path
XML-Example:
<?xml version="1.0" encoding="utf-8"?>
<unattend>
<servicing>
<package>
<assemblyIdentity/>
<source location="HERE\IS\MY\PATH"/>
</package>
<package>
<assemblyIdentity/>
<source location="HERE\IS\ANOTHER\PATH"/>
</package>
<package>
<assemblyIdentity/>
<source location="HERE\IS\ANOTHER\PATH"/>
</package>
</servicing>
</unattend>
$xml.unattend.servicing.package.source.locationYou can get the attributes via dot notation as well.