0

I'm very new to Powershell and need a very basic help.

I have a list of values as rows and want to make it as a string. Below is the list of items:

1011
1012
1013
1014
2014

I need to make this as 1011,1012,1013,1014,2014 and assign it to a variable.

1

1 Answer 1

2

You don't give any code but you want a command that looks like this:

$result= $list -Join ", "

where $list is your items on separate lines.

Here is an article that gives examples of lots of use cases:

midnightfreddie.com/powershell-split-and-join.html

Sign up to request clarification or add additional context in comments.

1 Comment

@ManojSivan - on stackoverflow it is best to up-vote and/or mark as correct an answer that helps. The "thanks" are nice but the up-votes are better.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.