Newbie to powershell I'm working on a TXT file to exchange data between two processes. I'm using the following rows to extract data from an XML file to the TXT file
$xmlElm.emXML.e_image_storage_entry.efile_reference | Out-File $Workpath\test1.txt -NoNewline
$xmlElm.emXML.e_image_storage_entry.eclient_id | Out-File $Workpath\test1.txt -Append
Now my problem is that there is no blank space between the two variables as I need.
The result is
E:\EM\e_storage\exp6272001752216699873.jpg241505829
... but I need
E:\EM\e_storage\exp6272001752216699873.jpg 241505829
with a space between the two variable. No metter if I must add an echo line or something else... Can anyone help me?
Construct the string before outputting to the file, much easier that way:
The above joins the values of
efile_referenceandeclient_idwith a space using the-joinoperator.Other way to construct the string can be interpolating these values in a expandable string using the
$( )operator: