Powershell commands show no output in gitlab CI/CD

Viewed 254

On my local machine when i start powershell and run a command it gives an output

C:\Users\>pwsh
PowerShell 7.1.4
Copyright (c) Microsoft Corporation.

https://aka.ms/powershell
Type 'help' to get help.

PS C:\Users\> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.1.4
PSEdition                      Core
GitCommitId                    7.1.4
OS                             Microsoft Windows 10.0.19042
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

PS C:\Users\>

However when I do this in my CI/CD it shows no output

$ pwsh
PowerShell 7.1.4
Copyright (c) Microsoft Corporation.
https://aka.ms/powershell
Type 'help' to get help.
PS /builds/arm-ttk> $ $PSVersionTable;
Running after_script
00:01
Running after script...

Is there a command to force output? I am not really sure if this is related to my gitlab ci/cd script.

This is what I have in gitlab

lint:
  image: mcr.microsoft.com/powershell
  stage: lint
  script:
    - apt-get install -y curl
    - apt-get install -y unzip
    - curl https://azurequickstartsservice.blob.core.windows.net/ttk/latest/arm-template-toolkit.zip --output arm-template-toolkit.zip
    - unzip arm-template-toolkit.zip
    - cd arm-ttk
    - pwsh
    - $PSVersionTable;
0 Answers
Related