2015-12-28 52 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步驟,與文章中的步驟相同。 –

相關問題