Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Read two different arrays and display

$
0
0

I have a text file, which has 1000 of entries in the way mentioned below:

Kozoscustomer

sabzeemployee

I am reading the content of text file and saving as an arrays.

$global:Content = get-content info.txt 
$global:Name=$Content | foreach { 
	$hashTab=@{Name="" ; Info=""}
	$hashTab.Name, $hashTab.Info=$_.Trim() -split '\s+'
	New-Object PSObject -Property $hashTab
	}
$global:Names=$ServerList | select -ExpandProperty Name
$global:Infos=$ServerList | select -ExpandProperty Info

How do I read two arrays, I mean read the values of two arrays one by one and display the result as:

NamesInfos

KozosCustomer

sabzeemployee


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>