title: Reading and running Powershell file from text
body: <p>Right now, I'm trying to use a Powershell script to read through a text file and execute all of the Powershell scripts mentioned in it, but I can't get any results.  I've tried specifying it this way:</p>
  
  <pre><code>Start-Job -ScriptBlock{powershell.exe -noexit $val} -name $jobnum
  </code></pre>
  
  <p>and this way:</p>
  
  <pre><code>Start-Job -ScriptBlock{$val}
  </code></pre>
  
  <p>(<code>$val</code> is the value of the line of text)
  but it doesn't run the script that's written on that line.</p>
  
  <p>And I've tried this way:</p>
  
  <pre><code>Start-Job -FilePath($val) -name $jobnum
  </code></pre>
  
  <p>But I get this error:</p>
  
  <blockquote>
    <p><code>Start-Job</code> : Only PowerShell script files are allowed for <code>FilePath</code> parameter. Specify a file with <code>.ps1</code> extension.</p>
  </blockquote>
  
  <p>Even though the value of <code>$val</code> is a legitimate path to a file with <code>ps1</code> extension!</p>
  
  <p>My text lines look like this: <code>C:\Users\me\Desktop\notepad.ps1</code></p>
  
  <p>How do I get my Powershell script to read in text and run the <code>ps1</code> scripts that have a path given in the text?</p>