Skip to content

The term 'C:\Program' is not recognized as the name of a cmdlet #63

@ladenedge

Description

@ladenedge

Where are you running it?

On-prem Azure DevOps Server

Version of Extension/Task

10.3.10

Expected behaviour and actual behaviour

Expected Pester to run when executed by an agent installed in the Program Files directory.

However, it looks like it's not quoting itself:

powershell.exe C:\Program Files\vsts-agent-win-x64-2.160.1\_work\(snip)\10.3.10\Pester.ps1

Here's the full script output:

Starting: Run unit tests
==============================================================================
Task         : Pester Test Runner
Description  : Run Pester tests by either installing the latest version of Pester at run time (if possible) or using the version shipped with the task (5.0.0)
Version      : 10.3.10
Author       : Pester
Help         : Version: #{Build.BuildNumber}#. [More Information](https://github.com/pester/AzureDevOpsExtension)
==============================================================================
Using executable 'powershell.exe'
powershell.exe C:\Program Files\vsts-agent-win-x64-2.160.1\_work\_tasks\Pester_cca5462b-887d-4617-bf3f-dcf0d3c622e9\10.3.10\Pester.ps1 -TestFolder C:\Program Files\vsts-agent-win-x64-2.160.1\_work\3\s\* -resultsFile C:\Program Files\vsts-agent-win-x64-2.160.1\_work\3/Pester-Results.xml -run32Bit False -FailOnStdErr true -CodeCoverageOutputFile C:\Program Files\vsts-agent-win-x64-2.160.1\_work\3/Pester-Coverage.xml
##[error]C:\Program : The term 'C:\Program' is not recognized as the name of a cmdlet, 

##[error]C:\Program : The term 'C:\Program' is not recognized as the name of a cmdlet, 

##[error]function, script file, or operable program. Check the spelling of the name, or 
if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ C:\Program Files\vsts-agent-win-x64-2.160.1\_work\_tasks\Pester_cca54 ...
+ ~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\Program:String) [], CommandN 
   otFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Steps to reproduce the problem

Very simple task usage in my DevOps pipeline:

- task: Pester@10
  displayName: 'Run unit tests'
  inputs:
    resultsFile: '$(Pipeline.Workspace)/Pester-Results.xml'
    CodeCoverageOutputFile: '$(Pipeline.Workspace)/Pester-Coverage.xml'

Metadata

Metadata

Assignees

No one assigned

    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