Create GitHub actions that use powershell scripts

Question:

I’d like to create a GitHub action that sets up an environment in Windows, running a few Powershell commands. Despite this can be done easily as a step, there does not seem to be a way to create a complete GitHub action for that. If I use this:

There does not seem a way to run anything other than a JS script, or even to declare the environment. I understand that’s left for later, during the job steps, but anyway it looks like a hack. Is there anything I’m missing here?

Answer:

You could also run docker directly with an entrypoint for the .ps1 script

Update:

The using field is the application to use to execute the code specified in main. But Github Actions only support using node12 and docker. As seen from this GHActions I just ran for example’s sake.

Docker won’t run in most Windows environment and you’d have to use Windows Server 2019 as your base environment.

Source:

Create GitHub actions that use powershell scripts by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply