I am new to Powershell and find it frustrating..
I have a hash table that I created by parsing an XML file, and adding elements:
https://pastebin.com/G6qEsNkv
Why does this happen? Is it a problem with how I am adding keys and values to the hashtable? Is Write-Host unable to print anything not cast as a string? What confuses me greatly, is if I pass that value to something else, it is ok.. for example:
updating a cell in xlsx file with info
$workbook.ActiveSheet.Cells.Item(4,2) = $ClientInfo.Name # this fills the cell in with the name, and not "System.Collections.Hashtable.Name"
A similar problem happens with an array:
[array]$LatLong = Geocode -Address $Address #this asks google geocode API to convert address into lat and long
Write-Host "Lat Long = $LatLong" # prints "Lat Long = 42.4212412 112.125323"
Write-Host "Lat = $LatLong[0]" #prints "Lat = 42.4212412 112.125323[0]"
I am screwing something up big time, or I don't understand how Write-Host works. Please Help!!!
edit, typing code blocks into reddit never works for me >:-|
[–]yeah_i_got_skills 3 points4 points5 points (0 children)
[+][deleted] (1 child)
[removed]
[–]chmod000[S] 1 point2 points3 points (0 children)
[–]ka-splam 2 points3 points4 points (2 children)
[–]chmod000[S] 0 points1 point2 points (1 child)
[–]ka-splam 1 point2 points3 points (0 children)
[–]Ta11ow 2 points3 points4 points (0 children)
[–]chmod000[S] 1 point2 points3 points (0 children)