Forum Discussion
johnmsch
Feb 07, 2023Copper Contributor
Write array values to Event Viewer?
Trying to debug an old PowerShell script that contains a small array, containing 5 -7 entries, each about 10-15 bytes long). I'm trying to write the contents of the array ($activeNode) to the Event ...
johnmsch
Feb 08, 2023Copper Contributor
PS C:\Users\jschneider> $activenode.gettype()
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True False DataRow System.Object
Feb 08, 2023
Ok... And what does $activenode.tostring() give you? (If possible?)
- johnmschFeb 08, 2023Copper Contributor
PS C:\Users\jschneider> $activenode.tostring() System.Data.DataRow
This is driving me nuts! It makes no sense.
- Feb 09, 2023
Did that work out for you?
- johnmschFeb 13, 2023Copper ContributorSorry, haven't had a chance to test this yet, but should by tomorrow.
- Feb 08, 2023https://stackoverflow.com/questions/12944824/powershell-parse-system-data-datarow-to-string , In your case, something like
$activenodeOut = $activenodeOut+ ($activenode[$i].ItemArray -join ",")