Trying to concatenate two variables with an array inside them.
First variable contains:
PS C:\WINDOWS\system32> $svcStatus
Response Status
-------- ------
200 OK
Second variable contains:
PS C:\WINDOWS\system32> $svcCall
displayName serviceTypeUrl port servicePort
----------- -------------- ---- -----------
AutnTestService http://demo1.ravn.co.uk/ravn-manage/api/v2/service_types/0310bf36-8fbd-4543-a79e-2b59f288d7e3 9000 9002
When they are joined:
PS C:\WINDOWS\system32>$mansvcApp = -join $svcStatus, $svcCall
$mansvcApp
@{Response=200; Status=OK}
displayName serviceTypeUrl port servicePort
----------- -------------- ---- -----------
AutnTestService http://demo1.ravn.co.uk/ravn-manage/api/v2/service_types/0310bf36-8fbd-4543-a79e-2b59f288d7e3 9000 9002
How can I get it to look like this:
displayName serviceTypeUrl port servicePort Response status
----------- -------------- ---- ----------- -------- ------
AutnTestService http://demo1.blah.co.uk/blah/api/v2/service_types/0310b 9000 9002 200 OK
-joinshould be used to join elements of an array into a string like this:$MyArray -join ","