title: Creating a GitHub Action which runs a Powershell script on a Windows host
body: <p>My GitHub Actions workflow &quot;runs-on&quot; <strong>windows-latest</strong>. I want a custom Action which executes a PowerShell (core or legacy is fine) script. I have a parallel action that runs on Linux and MacOS. So, my .github/actions/install-tf-win directory contains this action.yml</p>
  <pre class="lang-yaml prettyprint-override"><code>name: install_tf_win
  description: installs Terraform/TerraGrunt for Windows
  runs:
    using: &quot;composite&quot;
    steps:
      - run: install-tf-win\install-tf-win.ps1
        shell: pwsh
  </code></pre>
  <p>The directory also contains install-tf-win.ps1. I have tried all sorts of variations on that run statement. Starting with &quot;&amp;&quot; and without, variations in paths used with forwards and backwards slashes. I originally started with $GITHUB_ACTION_PATH/install-tf-win.ps1 (works for Linux/MacOS), however it seemed that GITHUB_ACTION_PATH was getting evaluated to be an empty string and then there were complaints about /install-tf-win.ps1 not being found. I tried both pwsh and powershell for the shell key value.</p>
  <p>The form shown above results in this error:</p>
  <pre><code>Run ./.github/actions/install-tf-win
  install-tf-win\install-tf-win.ps1: D:\a\_temp\c1d3d7fa-074b-4f90-ade0-799dcebd84ec.ps1:2
  Line |
     2 |  install-tf-win\install-tf-win.ps1
       |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       | The module 'install-tf-win' could not be loaded. For more information, run 'Import-Module
       | install-tf-win'.
  </code></pre>
  <p>I can obviously code my way around this by just putting the PowerShell statements in a step. But, the documentation suggests this should work. <a href="https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsshell" rel="nofollow noreferrer">https://docs.github.com/en/free-pro-team@latest/actions/creating-actions/metadata-syntax-for-github-actions#runsstepsshell</a> .</p>
  <p>So, how do I get this to work, please?</p>