I would like to loop through a CSV File and use the enties to create a .txt File.
CSV File would look like something like this:
Column1 Column2 Column3
------- ------- -------
Systemname1 User1 PasswordtEX#
Systemname2 User2 Password4k2P
Systemname3 User3 Password3Uch
Systemname4 User4 PasswordY0}(
Systemname5 User5 PasswordDhE"
Systemname6 User6 Password1TOs
So the code I had in mind would look like that:
$data = Import-Csv 'C:\Path.csv' -Delimiter ";"
ForEach ( $Systemname in $data) {
"Systemname is $Systemname.Column1 and the User I'm going to use it named $User.Column2 with the Password $Password.Column3" Add-content | out-file -filepath C:\path.txt -Append
}
And the .txt File would look like that
Systemname is Systemname1 and the User I'm going to use is named User1 with the Password PasswordtEX#
Systemname is Systemname2 and the User I'm going to use is named User2 with the Password Password4k2P
Systemname is Systemname3 and the User I'm going to use is named User3 with the Password Password3Uch
Systemname is Systemname4 and the User I'm going to use is named User4 with the Password PasswordY0}(
.... And so on
Am I totally off track? Would appreciate any help! Thanks in regards!