title: Replace string in an imported CSV file
body: <p>I need to import a CSV file and then replace full usernames <code>domain\username</code> with <code>username</code>.</p>
  
  <p>The following lines work but I only receive the amended usernames as the output and not the full file.</p>
  
  <p>Could you please advise?</p>
  
  <pre><code>$TestFile = Import-Csv .\file.csv 
  $NewFile = $TestFile | ForEach-Object {$_."Username" -replace 'domain\\',''}
  </code></pre>