in powershell, put the data into a variable, then you can do anything with it
write-host,out-host, write-file into a text file, whatever. you struggle because you're using "old thinking". took me a while to get out of that mode. stop using >>. thats not real powershell. do better!