I have an array named $RolesFunArray. It contains one or more elements like this:
ZPP01 0
ZPP02 1
ZPP03 1
All arrays are system.string except for $RolesFunArray which is system.object.
I am trying to output this variable to a text file. It always shows the object type and not the string. I have tried -join, [string]$RolesFunArray and several other things and none of them work (no errors, just more System.Object[]).
Basically, I am reading a larger file line by line, grabbing some text, matching that text against another file and then picking text from the two files and writing them together to that $Line variable, which I then am outputting to a new line in a third file. I want tabs between the variables in the $Line output.
Any ideas? Thanks!
Here is what I am using to output.
$Line = $FirstWord[1] + ([char]0x0009) + $TstcSplit[6] + ([char]0x0009) + $RolesFunArray
add-content -Encoding ASCII -path "c:\sapdl\test\$File.log" -value "$Line'r"
$FirstWordis a string? If not that would be an issue. That would be my first question since it would determine how the object is saved. Also, if$linewas typed earlier it would persist that way throughout the code.$RolesFunArrayshould just be a space delimited string if cast as such. What is$FirstWord.GetType().FullnameExport-CSV -delimiter "t"`$lineshould be string as well. Is that the case?