Powershell script to add CSv

This topic contains 1 reply, has 2 voices, and was last updated by  I Like Cheese 1 month ago.

  • Author
  • #102643


    $Csv = Import-Csv .\Test.csv
    foreach ($lol in $Csv) {
    $lol = "$($lol_.NEW_HOSTNAME)"

  • #102658

    I Like Cheese

    If you are looking for help, it is generally helpful to include exactly what problem you are having, or at minimum, describe in detail what you are trying to accomplish.

    Also you want to avoid using ambiguous variable names such as lol. Try naming them to be somewhat descriptive of the data they contain. It may seem trivial in such a short script that you have posted, but it is a good practice as debugging larger scripts that have meaningless variable names becomes very daunting very fast, especially if you are not the author.

You must be logged in to reply to this topic.