2016-03-13 70 views
0

我有以下PowerShell腳本可以將不同位置的相同位發佈到webapps。使用Powershell將web部署包發佈到Azure

Param(
[String]$WebsiteBaseName="mywebsitename", 
[String]$WebDeployPackage="./test.zip", 
[String]$locations="eastus;westus" 
) 
Select-AzureRmProfile -Path ./rmprofile 

$locationArray = $locations -split ';' 
# Iterate and deploy the package 
for($i = 1; $i -le $locationArray.Length; $i++) { 
    $WebsiteFullName = "'$WebsiteBaseName-$i'" 

    Publish-AzureWebsiteProject -Package "$WebDeployPackage" -Name $WebsiteFullName 
} 

但是,當運行腳本我收到以下錯誤。

Publish-AzureWebsiteProject : Value cannot be null. 
Parameter name: path2 

我在做什麼錯在這裏?我使用的是我在MSDN的文檔中找到的相同代碼。 該示例顯示了相同的代碼。

在此先感謝

+0

我想你打一個bug ......如果你運行Get-模塊在PowerShell會話什麼版本是否列出了「Azure」模塊? –

回答

0

可能去掉雙引號在腳本<「$ WebDeployPackage」>

+0

你能在這一個上添加更多信息嗎? –

相關問題