首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >远程安装和调用Pester

远程安装和调用Pester
EN

Stack Overflow用户
提问于 2015-06-30 13:52:49
回答 2查看 1.4K关注 0票数 0

我是PowerShell,Pester和新的VSO构建系统的新手,我试图让Pester为每个签入运行我的测试。我已经设置并配置了一个简单的PowerShell脚本,以便在每次签入时运行。

首先,我尝试简单地调用-Pester,看看VSO团队是否设想了这一点,并建立了通用的单元测试框架,但我得出了以下可预测的结果:

代码语言:javascript
复制
Invoke-Pester : The term 'Invoke-Pester' is not recognized as the name of a cmdlet, 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 C:\a\64df1c11\Operations Tools\powershell\runPowershellTests.ps1:1 char:1
+ Invoke-Pester
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Invoke-Pester:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

我尝试使用PSGet:

代码语言:javascript
复制
(new-object Net.WebClient).DownloadString("http://psget.net/GetPsGet.ps1") | iex
install-module Pester
Invoke-Pester

但这也行不通:

代码语言:javascript
复制
New-Item : Access to the path 'PsGet' is denied.
At line:17 char:5
+ New-Item -Path ($Destination + "\PsGet\") -ItemType Directory -Force | Out-N ...

如何远程安装和执行Pester以运行单元测试?

EN

回答 2

Stack Overflow用户

发布于 2015-06-30 14:25:30

用PsGet试试这个:

代码语言:javascript
复制
(new-object Net.WebClient).DownloadString("http://psget.net/GetPsGet.ps1") | iex
Install-Module Pester -Global

或者使用巧克力味

代码语言:javascript
复制
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
choco install pester
票数 1
EN

Stack Overflow用户

发布于 2016-03-01 11:03:47

VSO市场中有一个任务可以让您运行Pester单元测试。任务可以找到在市场上。您可以在:git Vsts上看到源代码

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31140200

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档