Skip to content

CommandNotFoundException only in AzureDevops #55

@FelixBrunet

Description

@FelixBrunet

Where are you running it?

  • Azure DevOps Service (VSTS)

Expected behaviour and actual behaviour

CommandNotFoundException: Could not find Command PSIISReset

I import with in Tests.ps1
. "$PSScriptRoot..\ArielDbCore\IISOperations.ps1"

	Mock -CommandName PSIISReset -MockWith { 
			Write-Output "Called fake PSIISReset"
		}

My pipeline :

  • task: Pester@10
    inputs:
    scriptFolder: "$(System.DefaultWorkingDirectory)\ArielDb-Orchestrator\Tests.ps1"
    resultsFile: "$(System.DefaultWorkingDirectory)\Test-Pester-ArielDb-Orchestrator.XML"
    CodeCoverageOutputFile: "$(System.DefaultWorkingDirectory)\ArielDb-OrchestratorCoverage.XML"
    usePSCore: False
    CodeCoverageFolder: "$(System.DefaultWorkingDirectory)\ArielDb-Orchestrator"
    preferredPesterVersion: '5.0.4'
    additionalModulePath: '$(System.DefaultWorkingDirectory)\ArielDb-Orchestrator'

Steps to reproduce the problem

It run fine on my machine using pester 5.0.4 but not with AzureDevops
I try setting 32bit=true, switching from importmodule to dotsourcing, preferredPesterVersion , additionalModulePath (which is not the good one right now, I dont have only one path for all import)

I think it's because i used powershell v5.1 on my machine, and remote is 7.1 ?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions