Skip to content

test-module.ps1 ignores local Az.Accounts even though its version is higher #1472

Description

@isra-fel

test-module.ps1 uses locally installed Az.Accounts if its version is higher than the embedded one, but it didn't and caused the test cases of Functions to fail.

To reproduce

git checkout main
git reset --hard upstream/main
git checkout -b functions-update-stacks-may-2025-base

# generate code
autorest --reset
autorest --powershell  --debug --verbose 3>&1 2>&1 > log.txt

# build module
.\build-module.ps1

# run tests
.\test-module.ps1 -Playback

Tests completed in 9.32s
Tests Passed: 0, Failed: 64, Skipped: 18, Pending: 0, Inconclusive: 0


PS C:\Users\x\code\azure-powershell\src\Functions\Functions.Autorest [68.08s]> gmo az.accounts -li

    Directory: C:\Users\x\Documents\PowerShell\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     4.2.0                 Az.Accounts                         Core,Desk {Disable-AzDataCollection, Disable-AzContextAutosave, Enable-AzDataCollection, Enable-AzContextAutosave…}

    Directory: C:\Program Files\WindowsPowerShell\Modules

ModuleType Version    PreRelease Name                                PSEdition ExportedCommands
---------- -------    ---------- ----                                --------- ----------------
Script     4.0.2                 Az.Accounts                         Core,Desk {Disable-AzDataCollection, Disable-AzContextAutosave, Enable-AzDataCollection, Enable-AzContextAutosave…}

Mannually remove the one in .\generated\modules\Az.Accounts can workaround this problem.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions