title: How do I overwrite a file using PowerShell?
body: <pre><code>New-Item -Path &quot;C:\aws&quot; -Name &quot;script.ps1&quot; -ItemType &quot;file&quot; -Value &quot;text in file&quot;
  </code></pre>
  <p>I am trying to create a file using the above command, if the file already exists I have to replace it with new file, it will have same file name. Please help</p>