# \#powershell

**URL:** https://forum.gitlab.com/tag/powershell/83.md

[Latest](https://forum.gitlab.com/latest.md) · [Categories](https://forum.gitlab.com/categories.md) · [Tags](https://forum.gitlab.com/tags.md)

---

## [PowerShell on GitLab CI - shared scripts](https://forum.gitlab.com/t/powershell-on-gitlab-ci-shared-scripts/133923)

<div class="topic-metadata">

**Author:** [@andrewducker](https://forum.gitlab.com/u/andrewducker)\
**Replies:** 3\
**Last updated:** [May 27, 2026, 1:31pm UTC](https://forum.gitlab.com/t/powershell-on-gitlab-ci-shared-scripts/133923 "2026-05-27T13:31:29Z")

</div>

I have a GitLab CI project set up to run a PowerShell Script that produces a report for the group it’s in. It looks like this: report: script: pwsh --Command ./runme.ps1 pages: true I want to put that yaml/scr…

---

## [Creating collapsible sections in pipeline shell scripts](https://forum.gitlab.com/t/creating-collapsible-sections-in-pipeline-shell-scripts/34611)

<div class="topic-metadata">

**Author:** [@maximojo](https://forum.gitlab.com/u/maximojo)\
**Replies:** 4\
**Last updated:** [November 11, 2025, 12:20pm UTC](https://forum.gitlab.com/t/creating-collapsible-sections-in-pipeline-shell-scripts/34611 "2025-11-11T12:20:38Z")

</div>

Hi, I want to create collapsible sections, as the help here describes, but from within a PowerShell script that is called as part of the run. So not in the .gitlab-ci.yml itself but within a PowerShell script that migh…

---

## [Shell handling for selfhosted runner](https://forum.gitlab.com/t/shell-handling-for-selfhosted-runner/116330)

<div class="topic-metadata">

**Author:** [@TheRealHorst](https://forum.gitlab.com/u/TheRealHorst)\
**Replies:** 0\
**Last updated:** [November 4, 2024, 9:58am UTC](https://forum.gitlab.com/t/shell-handling-for-selfhosted-runner/116330 "2024-11-04T09:58:54Z")

</div>

A naive question about the conceptional difference between following two alternatives for .gitlab-ci.yml file setting up a CI job of a GitLab project. Firstly, the runner configuration file config.toml file is configured…

---

## [Which is the correct syntax to read back the ExitCode from a powershell script?](https://forum.gitlab.com/t/which-is-the-correct-syntax-to-read-back-the-exitcode-from-a-powershell-script/57356)

<div class="topic-metadata">

**Author:** [@Dan](https://forum.gitlab.com/u/Dan)\
**Replies:** 5\
**Last updated:** [October 18, 2024, 6:10pm UTC](https://forum.gitlab.com/t/which-is-the-correct-syntax-to-read-back-the-exitcode-from-a-powershell-script/57356 "2024-10-18T18:10:02Z")

</div>

I am running on a windows PC a runner with the setting \*\* shell = “powershell” \*\* From gitlab CI/CD I call a powershell script this way: \> powershell -File ./script.ps1 \> - echo $LASTEXITCODE \> - echo $? …

---

## [Launching an interactive PowerShell instance with the same environment as a GitLab runner](https://forum.gitlab.com/t/launching-an-interactive-powershell-instance-with-the-same-environment-as-a-gitlab-runner/100371)

<div class="topic-metadata">

**Author:** [@Olumide](https://forum.gitlab.com/u/Olumide)\
**Replies:** 0\
**Last updated:** [February 26, 2024, 11:37am UTC](https://forum.gitlab.com/t/launching-an-interactive-powershell-instance-with-the-same-environment-as-a-gitlab-runner/100371 "2024-02-26T11:37:45Z")

</div>

I have a PowerShell runner runs a Python job that but spews out thousands of log messages in CI. When I log on to the machine that runs the CI job, launch a PowerShell instance and run the same command there are no erro…

---

## [Merge branch from different gitlab projects](https://forum.gitlab.com/t/merge-branch-from-different-gitlab-projects/95468)

<div class="topic-metadata">

**Author:** [@Kals](https://forum.gitlab.com/u/Kals)\
**Replies:** 0\
**Last updated:** [November 15, 2023, 4:16pm UTC](https://forum.gitlab.com/t/merge-branch-from-different-gitlab-projects/95468 "2023-11-15T16:16:12Z")

</div>

Hi all, i was asked to check if it is possible to merge 2 branches from different gitlab project. Can anybody help with this case ? Thanks in advance.

---

## [GitLab CI Runner Windows executes Powershell command differently to local Powershell](https://forum.gitlab.com/t/gitlab-ci-runner-windows-executes-powershell-command-differently-to-local-powershell/65853)

<div class="topic-metadata">

**Author:** [@jim.molkenthin](https://forum.gitlab.com/u/jim.molkenthin)\
**Replies:** 1\
**Last updated:** [September 11, 2023, 1:06am UTC](https://forum.gitlab.com/t/gitlab-ci-runner-windows-executes-powershell-command-differently-to-local-powershell/65853 "2023-09-11T01:06:19Z")

</div>

I have a Powershell command that starts a program with some arguments and waits for the execution to end. If I execute that command manually in Powershell everything works as expected. If I execute the same command thr…

---

## [Unable to run UiPath Built-in command in local machine: Access denied](https://forum.gitlab.com/t/unable-to-run-uipath-built-in-command-in-local-machine-access-denied/92021)

<div class="topic-metadata">

**Author:** [@NazaLearn](https://forum.gitlab.com/u/NazaLearn)\
**Replies:** 0\
**Last updated:** [September 3, 2023, 10:43pm UTC](https://forum.gitlab.com/t/unable-to-run-uipath-built-in-command-in-local-machine-access-denied/92021 "2023-09-03T22:43:06Z")

</div>

Hello all, First of all, please bear with me as I am new to Ci/Cd concepts and am trying things now. I would like to create a CiCd process in UiPath in which I tell the GitLab runner to go to the folder of UiPath studi…

---

## [Shell executor on Windows Powershell spews setup commands and secrets in the log](https://forum.gitlab.com/t/shell-executor-on-windows-powershell-spews-setup-commands-and-secrets-in-the-log/81320)

<div class="topic-metadata">

**Author:** [@RuterFrode](https://forum.gitlab.com/u/RuterFrode)\
**Replies:** 1\
**Last updated:** [February 8, 2023, 8:34am UTC](https://forum.gitlab.com/t/shell-executor-on-windows-powershell-spews-setup-commands-and-secrets-in-the-log/81320 "2023-02-08T08:34:52Z")

</div>

I’ve set up a runner on a Windows 10 laptop at work, which I intend to run Android UI tests against physical hardware. In all steps of the job we can see under-the-hood gitlab commands being executed with local echo on t…

---

## [Powershell multi-line script not executing Invoke-Command](https://forum.gitlab.com/t/powershell-multi-line-script-not-executing-invoke-command/68799)

<div class="topic-metadata">

**Author:** [@danielgroh](https://forum.gitlab.com/u/danielgroh)\
**Replies:** 0\
**Last updated:** [April 26, 2022, 2:50pm UTC](https://forum.gitlab.com/t/powershell-multi-line-script-not-executing-invoke-command/68799 "2022-04-26T14:50:45Z")

</div>

We have a multi-line script in powershell and Invoke-Commnand whithin this multi-line script is not working. Here is my job: deploy:dev1: stage: deploy variables: SERVER: "SERVER\_PATH" script: - | $e…

---

## [GitLab CI/CD script problem with powershell command](https://forum.gitlab.com/t/gitlab-ci-cd-script-problem-with-powershell-command/64399)

<div class="topic-metadata">

**Author:** [@priombiswas47](https://forum.gitlab.com/u/priombiswas47)\
**Replies:** 0\
**Last updated:** [January 20, 2022, 8:51pm UTC](https://forum.gitlab.com/t/gitlab-ci-cd-script-problem-with-powershell-command/64399 "2022-01-20T20:51:57Z")

</div>

GitLab CI/CD script problem with powershell command I am trying to run a pipeline with the job specified like below: test-win: stage: test tags: \["windows\_camv"\] script: - 'cd .\\Modules\\test.eaYamlExporter\\eaY…

---

## [Local 'shell' runner on windows started to fail due to error in GL build scrpt](https://forum.gitlab.com/t/local-shell-runner-on-windows-started-to-fail-due-to-error-in-gl-build-scrpt/63288)

<div class="topic-metadata">

**Author:** [@sslv.post](https://forum.gitlab.com/u/sslv.post)\
**Replies:** 0\
**Last updated:** [December 23, 2021, 7:39am UTC](https://forum.gitlab.com/t/local-shell-runner-on-windows-started-to-fail-due-to-error-in-gl-build-scrpt/63288 "2021-12-23T07:39:56Z")

</div>

Hello. I have a local runner on windows, type is ‘shell’. It was working ok previously, at least several days ago. Now when I did push to repo, the build job fails consistently. Looks like an error in build script: git-…

---

## [Issue With 32-bit Windows Runners](https://forum.gitlab.com/t/issue-with-32-bit-windows-runners/61348)

<div class="topic-metadata">

**Author:** [@emi](https://forum.gitlab.com/u/emi)\
**Replies:** 0\
**Last updated:** [November 13, 2021, 7:19am UTC](https://forum.gitlab.com/t/issue-with-32-bit-windows-runners/61348 "2021-11-13T07:19:54Z")

</div>

I’m having two issues with our 32-bit Windows runners that I suspect are related. The runners are at version 14.4.0 and our GitLab instance is at version 14.4.1-ee. The runners are tied to specific machines running 32-bi…

---

## [Run windows-app in foreground mode](https://forum.gitlab.com/t/run-windows-app-in-foreground-mode/58176)

<div class="topic-metadata">

**Author:** [@prog\_mersibo](https://forum.gitlab.com/u/prog_mersibo)\
**Replies:** 0\
**Last updated:** [September 6, 2021, 7:15pm UTC](https://forum.gitlab.com/t/run-windows-app-in-foreground-mode/58176 "2021-09-06T19:15:53Z")

</div>

Hey! I have a local gitlab-runner configured on my Windows machine to execute powershell-scripts. I am looking for an opportunity to start some process in foreground mode with a window and a gui (and may be under admin…

---

## [How do I open the GUI when triggering a gitlab job?](https://forum.gitlab.com/t/how-do-i-open-the-gui-when-triggering-a-gitlab-job/57814)

<div class="topic-metadata">

**Author:** [@Dan](https://forum.gitlab.com/u/Dan)\
**Replies:** 0\
**Last updated:** [August 30, 2021, 8:08am UTC](https://forum.gitlab.com/t/how-do-i-open-the-gui-when-triggering-a-gitlab-job/57814 "2021-08-30T08:08:10Z")

</div>

I do have a yml-file which runs a powershell script which starts an application on a local windows PC. This works so far when triggering the job from gitlab. On the other hand I can see that the application has been star…

---

## [CI release tag building wrong eleas-cli format for powershell?](https://forum.gitlab.com/t/ci-release-tag-building-wrong-eleas-cli-format-for-powershell/55320)

<div class="topic-metadata">

**Author:** [@OIiM](https://forum.gitlab.com/u/OIiM)\
**Replies:** 4\
**Last updated:** [August 9, 2021, 12:19pm UTC](https://forum.gitlab.com/t/ci-release-tag-building-wrong-eleas-cli-format-for-powershell/55320 "2021-08-09T12:19:36Z")

</div>

Trying to use release-cli from .gitlab-ci.yml, it looks to me like the command line isn’t assembled correctly for Powershell. The following (normally the url is a package link build from variables, but I also tried this…

---

## [How to use Gitlab CI using host configuration?](https://forum.gitlab.com/t/how-to-use-gitlab-ci-using-host-configuration/50008)

<div class="topic-metadata">

**Author:** [@PParthenis](https://forum.gitlab.com/u/PParthenis)\
**Replies:** 2\
**Last updated:** [March 19, 2021, 2:28pm UTC](https://forum.gitlab.com/t/how-to-use-gitlab-ci-using-host-configuration/50008 "2021-03-19T14:28:34Z")

</div>

Hello Gitlab community, My name is Panagiotis Parthenis and I am a software Engineer. I was trying to use the GitLab CI/CD pipelines, but I would need some help. In my case, I would like each push to execute the CI/CD …

---

## [Pausing running by sending PUT API requests using powershell](https://forum.gitlab.com/t/pausing-running-by-sending-put-api-requests-using-powershell/49070)

<div class="topic-metadata">

**Author:** [@daz](https://forum.gitlab.com/u/daz)\
**Replies:** 1\
**Last updated:** [February 16, 2021, 4:24pm UTC](https://forum.gitlab.com/t/pausing-running-by-sending-put-api-requests-using-powershell/49070 "2021-02-16T16:24:52Z")

</div>

I am having difficulty getting the powershell command right to be able to pause runners using the API, please can someone help me get the command to work. The linux format from https://docs.gitlab.com/ee/api/runners.htm…

---

## [Executing MSBuild with variables in stage returns "project file does not exist"](https://forum.gitlab.com/t/executing-msbuild-with-variables-in-stage-returns-project-file-does-not-exist/44970)

<div class="topic-metadata">

**Author:** [@SPSamL](https://forum.gitlab.com/u/SPSamL)\
**Replies:** 0\
**Last updated:** [November 9, 2020, 8:43pm UTC](https://forum.gitlab.com/t/executing-msbuild-with-variables-in-stage-returns-project-file-does-not-exist/44970 "2020-11-09T20:43:31Z")

</div>

I have a build process that uses MSBuild to update Azure SQL Managed Instance databases. Essentially, it runs .sql scripts to make these updates. I have successfully ran the commands in PowerShell on a VM. However, when …

---

## [Copy Errors in Build Directory (PowerShell)](https://forum.gitlab.com/t/copy-errors-in-build-directory-powershell/28857)

<div class="topic-metadata">

**Author:** [@shantyman](https://forum.gitlab.com/u/shantyman)\
**Replies:** 0\
**Last updated:** [August 8, 2019, 11:54am UTC](https://forum.gitlab.com/t/copy-errors-in-build-directory-powershell/28857 "2019-08-08T11:54:22Z")

</div>

I am at ground zero for using/learning Gitlab CI. As such I am trying to come up with a basic workflow of getting a batch of PowerShell scripts we have sitting on a server into version control. The workflow is meant to b…

---

## [\[RESOLVED\] Gitlab runner - ssh GetConsoleMode issue](https://forum.gitlab.com/t/resolved-gitlab-runner-ssh-getconsolemode-issue/28467)

<div class="topic-metadata">

**Author:** [@snowinmars](https://forum.gitlab.com/u/snowinmars)\
**Replies:** 1\
**Last updated:** [July 31, 2019, 9:50am UTC](https://forum.gitlab.com/t/resolved-gitlab-runner-ssh-getconsolemode-issue/28467 "2019-07-31T09:50:59Z")

</div>

Hi. I’m using a GitLab Windows runner for building my application and ssh deploying it to a Windows machine. The .gitlab-ci.yml starts a powershell script, the powershell script opens an shh connection to a machine. I…

---

## [Running multi-line commands with powershell](https://forum.gitlab.com/t/running-multi-line-commands-with-powershell/19708)

<div class="topic-metadata">

**Author:** [@rleigh](https://forum.gitlab.com/u/rleigh)\
**Replies:** 3\
**Last updated:** [November 5, 2018, 12:06pm UTC](https://forum.gitlab.com/t/running-multi-line-commands-with-powershell/19708 "2018-11-05T12:06:10Z")

</div>

Hi folks, I’ve set up a runner on WIndows 10 with shell=powershell. In the gitlab-ci.yml I’m trying to invoke a command split over multiple lines. With powershell, you’re supposed to use the backtick (\`) as the escape…

---

## [Facing Issues with Gitlab Runner at Windows--Need Help](https://forum.gitlab.com/t/facing-issues-with-gitlab-runner-at-windows-need-help/19942)

<div class="topic-metadata">

**Author:** [@tarunkumard](https://forum.gitlab.com/u/tarunkumard)\
**Replies:** 0\
**Last updated:** [October 13, 2018, 10:02am UTC](https://forum.gitlab.com/t/facing-issues-with-gitlab-runner-at-windows-need-help/19942 "2018-10-13T10:02:31Z")

</div>

Hi All, Followed all the steps mentioned to bring up gitlab runner up and running ,but getting below error while trying to start,mind you starting with powershell as ADMIN Failed to start gitlab-runner: The service can…
