title: How can I run this PowerShell script in a batch file?
body: <p>How can I run this PowerShell script in a batch file?</p>
  <pre><code>(netsh wlan show profiles) | Select-String &quot;\:(.+)$&quot; |
  %{$name=$_.Matches.Groups[1].Value.Trim(); $_} |
  %{(netsh wlan show profile name=&quot;$name&quot; key=clear)}  |
  Select-String &quot;Key Content\W+\:(.+)$&quot; |
  %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} |
  %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} |
  Format-Table -AutoSize &gt;&gt; &quot;Wifi.txt&quot;
  </code></pre>
  <p>I found some solutions, but I couldn't find a regular way, so I couldn't solve this problem.</p>
  <p>I want to run all PowerShell lines in one line in a batch file, like <code>powershell.exe -command.....</code>, but I don't know how to put the sentence like this.</p>