2017-05-04 23 views
0

找不到當使用Visual Studio 2017年Windows 7的機器上部署我最近開始收到一條錯誤消息,Azure的ARM模板,其中僅第二部署模板後出現Executable script code found in signature block。我發現幾個提到這個錯誤的消息來源,但除了關閉和重新打開Visual Studio之外,沒有一個解決方案實際上不是可接受的解決方案。我已經包括下面的完整部署日誌:可執行腳本代碼在簽名塊錯誤

17:40:53 - The following parameter values will be used for this operation: 
17:40:53 -  AZTemplateTestName: AZTemplateTest-AppService 
17:40:53 -  AZTemplateTestSkuName: S1 
17:40:54 - Build started. 
17:40:54 - Project "AZTemplateTest.deployproj" (StageArtifacts target(s)): 
17:40:54 - Project "AZTemplateTest.deployproj" (ContentFilesProjectOutputGroup target(s)): 
17:40:54 - Done building project "AZTemplateTest.deployproj". 
17:40:54 - Done building project "AZTemplateTest.deployproj". 
17:40:54 - Build succeeded. 
17:40:54 - Launching PowerShell script with the following command: 
17:40:54 - 'C:\Users\username\documents\visual studio 2017\Projects\AZTemplateTest-Test\AZTemplateTest-Test\bin\Debug\staging\AZTemplateTest\Deploy-AzureResourceGroup.ps1' -StorageAccountName '' -ResourceGroupName 'AZTemplateTest-Test-2' -ResourceGroupLocation 'eastus' -TemplateFile 'C:\Users\username\documents\visual studio 2017\Projects\AZTemplateTest-Test\AZTemplateTest-Test\bin\Debug\staging\AZTemplateTest\azuredeploy.json' -TemplateParametersFile 'C:\Users\username\documents\visual studio  2017\Projects\AZTemplateTest-Test\AZTemplateTest-Test\bin\Debug\staging\AZTemplateTest\azuredeploy.parameters.json' -ArtifactStagingDirectory '.' -DSCSourceFolder '.\DSC' 
17:40:54 - [ERROR] At line:1 char:2337 
+ $UI = 'VS-'; if (!(Test-Path 'C:\Users\username\AppData\Roaming\Windows Azure P ... 
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
Executable script code found in signature block. 

更有趣的是,如果我去C:\Users\username\AppData\Roaming適合的唯一文件夾的Windows Azure P模式是Windows Azure Powershell。在該文件夾中,唯一存在的內容是AzureDataCollectionProfile.json,只有在我選擇了Azure數據收集或選擇退出Azure數據收集的情況下才包含此信息。如果我嘗試刪除該文件和/或文件夾,結果保持不變。

我還試圖找到解決辦法,希望以下內容:完全

  • 創建一個新的項目,相同的結果
  • 清潔項目,相同的結果
  • 重建項目,相同的結果
+0

你在psversion 3?請給我們通知我們你在 –

+0

的PS版本我認爲你已經陷入了一個錯誤。一種解決方法是直接調用PowerShell腳本,而不是通過VS.使用此調整[TWEAK](https://github.com/pester/Pester/commit/92f94357bbce01caded6f3b3cfddbcb528f56436) –

+0

@RanadipDutta是,這是V3。 – jak119

回答

0

這是Win7上的PowerShell 3中的一個已知問題 - 我們唯一的修復方法是升級PowerShell。