Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

Manipulating text with a PowerShell script

$
0
0

I've got a ulility that gives me text output that I read into an array of strings.  The 4th word in each string is the name of the vm I need to do other operations on.  How can I perform operations on that name?

Currently, I output a csv header row, change all the spaces to commas ($a = $a -replace "\s+",","), then append the string array to the file, creating a csv.

Then I read the csv back into PowerShell using Import-Csv and manipulate the .Name object.

Is there an easier way of getting this done?

Thanks


Viewing all articles
Browse latest Browse all 2562

Latest Images

Trending Articles



Latest Images

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