title: github runner on Windows not finding executables on PowerShell
body: <p>I am trying to use a self-hosted Windows-VM to run west for repo management, python to run some scripts, and git to push back to the repo.</p>
  <p>The work is to generate files using python from <code>repo-A</code> as artifacts to check-into <code>repo-B</code>. I had to use Windows because the file generation tools only works on Windows.</p>
  <p>I have a self-hosted build agent setup and able to run github actions on it.</p>
  <p>On the VM side, these are the path to the relevant commands (showing that they are properly added to $PATH)</p>
  <pre><code>PS C:\TouchGFXProjects\wallSwitch-gui-hesPrototype-480-272&gt; gcm west; gcm tgfx.exe; gcm python; gcm git
  
  CommandType     Name                                               Version    Source
  -----------     ----                                               -------    ------
  Application     west.exe                                           0.0.0.0    C:\Users\tgfx\AppData\Local\Programs\Python\Python39\Scripts\west.exe
  Application     tgfx.exe                                           4.16.1.0   C:\TouchGFX\4.16.1\designer\tgfx.exe
  Application     python.exe                                         3.9.515... C:\Users\tgfx\AppData\Local\Programs\Python\Python39\python.exe
  Application     git.exe                                            2.31.1.1   C:\Program Files\Git\cmd\git.exe
  </code></pre>
  <p>The VM's execution Policy is set to:</p>
  <pre><code>PS C:\Windows\system32&gt; Get-ExecutionPolicy -List
          Scope ExecutionPolicy
          ----- ---------------
  MachinePolicy       Undefined
     UserPolicy       Undefined
        Process       Undefined
    CurrentUser       Undefined
   LocalMachine          Bypass
  </code></pre>
  <p>All the scrips and execution steps ran well when executed from powerShell on the VM itself.
  But when I invoke the github runner, the behaviour indicates that it does not know where the executables are, despite it being known in <code>$PATH</code> (see debug output below).</p>
  <p>github runner script:</p>
  <pre><code>name: CI
  
  on:
      workflow_dispatch:
      pull_request:
          branches:
              - master
              - 'feature/**'
  
  jobs:
    # Test-path access using powerShell shell
    test-path-powerShell:
      runs-on: [self-hosted, Windows, X64, touchGFX]
      steps:
        - name: Display the path
          run: echo ${env:PATH}
          shell: powershell
          continue-on-error: true
  
        - name: Check that we know where python is
          run: gcm python
          shell: powershell
          continue-on-error: true
  
        - name: Test calling &quot;python.exe --version&quot; via powershell
          run: python.exe --version
          shell: powershell
          continue-on-error: true
    
        - name: Test calling &quot;python.exe --version&quot; via powershell (abs path)
          run: C:\Users\tgfx\AppData\Local\Programs\Python\Python39\python.exe --version
          shell: powershell
          continue-on-error: true
  </code></pre>
  <p>When running on the github runner, the echo ${env:PATH} command shows:</p>
  <pre><code>Run echo ${env:PATH}
  C:\TouchGFX\4.16.1\designer;C:\Users\tgfx\AppData\Local\Programs\Python\Python39\;C:\Users\tgfx\AppData\Local\Programs\Python\Python39\Scripts\;C:\Users\tgfx\AppData\Local\Programs\Python\Python39\Lib\site-packages;C:\Program Files\Git\cmd;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Microsoft\WindowsApps
  </code></pre>
  <p>Which means it should have the location for python.exe</p>
  <p>However, all commands that attempts to access it (even with Absolute path) returns errors like this:</p>
  <pre><code>Run gcm python
  gcm : The term 'python' is not recognized as the name of a cmdlet, function, script file, or operable program. Check 
  the spelling of the name, or if a path was included, verify that the path is correct and try again.
  At C:\actions-runner\_work\_temp\c19697cd-d5e0-4102-a7b6-5f357f82aa91.ps1:2 char:1
  + gcm python
  + ~~~~~~~~~~
      + CategoryInfo          : ObjectNotFound: (python:String) [Get-Command], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand
  </code></pre>
  <p>I also tried appending python to $GITHUB_PATH with:</p>
  <pre><code>echo &quot;C:\Users\tgfx\AppData\Local\Programs\Python\Python39&quot; | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
  </code></pre>
  <p>But that just extends the output of echo ${env:PATH} and still leads to the same error on execution.</p>
  <p>What am I missing?</p>
  <p>Thanks for everyone's time.</p>