Skip to content

Instantly share code, notes, and snippets.

@ishu3101
Created June 8, 2017 07:27
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ishu3101/0bdb1ec60a1371b07414bd0ab28f4227 to your computer and use it in GitHub Desktop.
Save ishu3101/0bdb1ec60a1371b07414bd0ab28f4227 to your computer and use it in GitHub Desktop.
Run PowerShell Command/Script from a .gitlab-ci.yml file on a gitlab.com using the Gitlab CI
image: philippheuer/docker-gitlab-powershell
test:
stage: test
script:
# run PowerShell script
- powershell -File build.ps1
# run PowerShell Command
- powershell -Command "Get-Date"
@aksimoNpriv
Copy link

Is it possible to put powershell commands inside gitlab-ci.yaml instead in build.ps1 file??

@charsi
Copy link

charsi commented Jun 9, 2022

@aksimoNpriv yes. You can do it like this ..

test:
  stage: test
  script: 
    - |
      powershell command 1
      powershell command 2
      # paste the contents of build.ps1 here

@abohnenberger
Copy link

how do I run this with a runner installed on my windows PC?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment