4

PowerShell スクリプトを実行して Azure PowerShell のサイレント インストールを実行すると、次の例外がスローされます。

"2" 個の引数を指定して "DownloadInstallerFile" を呼び出し中に例外が発生しました: "このメソッドに渡された InstallerContext には、Null でない InstallerFile が必要です。" 行:18 文字:5

スクリプトは次のとおりです。

[reflection.assembly]::LoadWithPartialName("Microsoft.Web.PlatformInstaller") | Out-Null

$ProductManager = New-Object Microsoft.Web.PlatformInstaller.ProductManager
$ProductManager.Load()
$product = $ProductManager.Products | Where { $_.ProductId -eq "WindowsAzurePowerShell" }

$InstallManager = New-Object Microsoft.Web.PlatformInstaller.InstallManager

$Language = $ProductManager.GetLanguage("en")
$installertouse = $product.GetInstaller($Language)

$installer = New-Object 'System.Collections.Generic.List[Microsoft.Web.PlatformInstaller.Installer]'
$installer.Add($installertouse)
$InstallManager.Load($installer)

$failureReason=$null
foreach ($installerContext in $InstallManager.InstallerContexts) {
    $InstallManager.DownloadInstallerFile($installerContext, [ref]$failureReason)
}
$InstallManager.StartInstallation()

どうすればこれを修正できますか?

4

0 に答える 0