Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ladenedge opened this issue Feb 2, 2022 · 0 comments · May be fixed by #64
Open

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

ladenedge opened this issue Feb 2, 2022 · 0 comments · May be fixed by #64

Comments

@ladenedge
Copy link

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'
ladenedge added a commit to ladenedge/AzureDevOpsExtension that referenced this issue Feb 2, 2022
ladenedge added a commit to ladenedge/AzureDevOpsExtension that referenced this issue Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant