2015-12-28 43 views
-1

我在Visual Studio Team Services上创建了一个CI构建版本来构建我的ASPNET 5网站。Azure PowerShell脚本 - 无法验证参数“名称”上的参数

我按照this article中的步骤操作。

我有第一个PowerShell脚本拉下DNX,并且项目通过构建步骤成功构建。

但是,Azure PowerShell脚本步骤失败。

调试它,我创建了一个简单的脚本PSPing.ps1只包含以下内容:

Write-Host "Hello World"

构建过程的结构如下:

enter image description here

当我运行该过程,我收到以下错误:

ScriptPath= C:\a\1\s\scripts\PingAuth.ps1 scriptCommand= & "C:\a\1\s\scripts\PingAuth.ps1" Cannot validate argument on parameter 'Name'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. Cannot index into a null array. Deploy Url: Website Name:

我不明白这个错误,我不明白的地方部署网址网站名称从何而来?

+0

Downvote,请发布导致问题的代码而不是链接。包含您尝试解决问题的内容也很有帮助。 – user4317867

+0

我已经包含了构建步骤的图像。我没有解释我做了什么来尝试解决这个问题 - 我创建了一个简单的PowerShell脚本,并将其添加为第一步。 –

回答

0

根据链接,PublishAspNet5Website.ps1脚本正在查找两个参数。 See this page了解更多关于高级参数的信息。

该脚本的第一行是param($websiteName, $packOutput)这意味着脚本必须被这样PublishAspNet5Website.ps1 -websiteName {WebSite}-packOutput $(Build.SourcesDirectory)\{yourProjectName}\artifacts\bin\$(BuildConfiguration)\Publish

执行这些参数在步骤12

12. 在脚本参数输入看出添加以下参数。 -websiteName {yourWebsiteName} -packOutput $(Build.SourcesDirectory){yourProjectName} \ artifacts \ bin \ $(BuildConfiguration)\ Publish

+0

我从最初的Azure PowerShell步骤以及我指向的.ps1脚本中删除了参数(...)。我这样做是为了在调试的时候尽量简化。 正如您所看到的,在此过程的后面还有第二个PowerShell步骤,与文章中的步骤相同。 –

相关问题