title: Replacing a line of text in .ini using PowerShell
body: <p>Hello I am trying to run a script in PowerShell ISE to replace a line of text in an .ini file. </p>
  
  <pre><code>(Get-Content C:\ProgramData\Nuance\NaturallySpeaking12\nssystem.ini) | ForEach-Object { $_ -replace "Default NAS Address=","Default NAS Address=BHPAPPDGN01V" } | Set-Content C:\ProgramData\Nuance\NaturallySpeaking12\nssystem.ini
  </code></pre>
  
  <p>This script works BUT when I run it multiple times the .ini text keeps getting added to the end of the line giving me a bunch of junk. </p>
  
  <blockquote>
    <p>Example: Ran script 4 times "Default NAS
    Address=BHPAPPDGN01VBHPAPPDGN01VBHPAPPDGN01VBHPAPPDGN01V"</p>
  </blockquote>