Skip to content

[BUG] CloudShell tools tests are failing to run #520

@surajssd

Description

@surajssd

With error: The term 'Install-Module' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

To Reproduce

Run the following command to reproduce this issue:

docker run \
   --volume $(pwd)/tests:/tests \
   -it ghcr.io/surajssd/cloudshell/tools:master-a9a24d4-20250210-122546 \
   /tests/test.sh

Above image was built on Feb 10th.

Observed Behavior

$ docker run \
   --volume $(pwd)/tests:/tests \
   -it ghcr.io/surajssd/cloudshell/tools:master-a9a24d4-20250210-122546 /tests/test.sh
Creating user
running root-level tests

Starting discovery in 1 files.
Discovery found 1 tests in 154ms.
Running tests.
[+] /tests/Root.Tests.ps1 59.3s (58.95s|221ms)
Tests completed in 59.31s
Tests Passed: 1, Failed: 0, Skipped: 0, Inconclusive: 0, NotRun: 0
running tests as csuser
Install-Module: /tests/test.ps1:8
Line |
   8 |  Install-Module -Name Pester -Force
     |  ~~~~~~~~~~~~~~
     | The term 'Install-Module' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if
     | a path was included, verify that the path is correct and try again.

Expected behavior

The tests should pass.

Is this specific to Cloud Shell?

Something seems to be wrong with the Powershell installation.

Interface information

Using the poweshell image locally.

Additional context

Here is a GH action run that failed: https://github.com/Azure/CloudShell/actions/runs/13231016533/job/36928157459

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Triage-neededTriage needed by Cloud Shell teambugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions