In fact all I needed is the piece of code in your function where I put my import-csv -path c:\csvfile.csv | select-object computername -expandproperty computrername in a variable and created another variable and used " join ',' " with the first one.
I fed that to set-item parameter "-value" and it worked. What a rookie thing not to know the "join" operator to join a bunch of imported strings and delimited them with commas.
Well I didn't konw how to do it and I wanted to use a "oneliner".
thank you once more.
The topic ‘wsman:\localhost\Client\TrustedHosts How to add a bunch of strings/ComputerNames’ is closed to new replies.