title: Running a batch file through powershell with content from a text file
body: <p>I am hoping someone can help me on this, I have a script that Removes and updates FSRM groups on windows server 2012-2019, I want to create a ps script that cycles through a text file, in each line it stores the value as a variable that can be used in the batch file.</p>
  <p>here is my code below; I just can't think of where to go after this;</p>
  <pre><code>$BF = gc &quot;C:\Installs\FSRM_SCRIPTS\FILESCREEN_EXPORT\FSRM_Groups.txt&quot;
  $env:FSRM_Group
   
  $FS = Foreach($BT in $BF){
  
  Start-Process &quot;cmd.exe&quot;  &quot;/c C:\INSTALLS\FSRM_SCRIPTS\FILESCREEN_EXPORT\New_Exports\Batch_Import.bat&quot;
  }
  
  $FS | out-file &quot;C:\Installs\FSRM_SCRIPTS\FILESCREEN_EXPORT\New_Exports\Results\$env:COMPUTERNAME - Import.txt&quot;
  </code></pre>