使用-Force失败删除AzureRmStorageAccount

时间:2017-02-06 21:08:17

标签: powershell powershell-v4.0 octopus-deploy

我试图通过Octopus运行以下powershell脚本

$ResourceGroupName = "#{ResourceGroupName}"
$StorageAccountName = "#{ScriptStorageAccount}"
# Remove storage account 
Remove-AzureRmStorageAccount -ResourceGroupName $ResourceGroupName -AccountName $StorageAccountName -Force

哪个适用于我的笔记本电脑但在Octopus服务器上失败,出现以下错误

20:49:51   Verbose  |       Invoking target script "C:\Octopus\Work\20170206204944-14912\scripts\post-deployement.ps1" with  parameters
20:49:54   Error    |       Invoke-Expression : A parameter cannot be found that matches parameter name
20:49:54   Error    |       'Force'.
20:49:54   Error    |       At C:\Octopus\Work\20170206204944-14912\scripts\Octopus.AzureContext.ps1:99
20:49:54   Error    |       char:5
20:49:54   Error    |       +     Invoke-Expression ". $OctopusAzureTargetScript $OctopusAzureTarge ...
20:49:54   Error    |       +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20:49:54   Error    |       + CategoryInfo          : InvalidArgument: (:) [Invoke-Expression], Parame
20:49:54   Error    |       terBindingException
20:49:54   Error    |       + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Comm
20:49:54   Error    |       ands.InvokeExpressionCommand
20:49:54   Fatal    |       The remote script failed with exit code 1

我在章鱼上有版本(PSVersion:5.0.10586.117)(版本:3.7.4)

0 个答案:

没有答案