首页 > 解决方案 > 无法使用 PowerShell 安装 WebSphere setup.exe

问题描述

通过使用下面的代码,我可以从网上下载 zip 文件,然后将其解压缩到一个文件夹中,然后转到 Windows 文件夹 → setup.exe。我可以双击setup.exe但我无法进行静默安装或在安装界面上单击确定/下一步。

图片

PowerShell代码:

if ($installationItem.FeatureName -match "WebSphere-Features") {
    # if software directory not exists then create it
    if (!(Test-Path $installationItem.FolderPath)) {
          New-Item -ItemType Directory -Force -Path $installationItem.FolderPath | Out-Null
    }

    Write-Host "Downloading WebSphere... "

    $client.DownloadFile($installationItem.Source, $installationItem.FilePath)
    if (!(Test-Path $installationItem.FilePath)) {
        Write-Host "Downloading $installationItem.FilePath failed"
        return
    }

    Expand-Archive -Force -Path $installationItem.FilePath -DestinationPath  $installationItem.FolderPath
    # check if websphere already installed
    if (Test-Path $installationItem.Test_Path) {
        Write-Host 'Websphere Already Installed ..Skipping installtion of websphere.'
        return
    } else {
        # Provide full access to the executable file to run
        Unblock-File -Path $installationItem.FilePath1

        # process installation
        $proc1 = Start-Process -FilePath $installationItem.FilePath1 -ArgumentList "/s /v /qn REBOOT=ReallySuppress" -Wait -PassThru -Verb "RunAs"

        $proc1.WaitForExit()

setting.xml

<?xml version="1.0"?>
<InstallationManagement>
    <Installation Name="WebSphere" FeatureName="WebSphere-Features" Source="https://path/ibm_webshpere-1.zip" FolderPath="C:\softwares\websphere" FilePath="C:\softwares\ibm_webshpere-1.zip" FilePath1="C:\softwares\websphere\Windows\Setup.exe" Test_Path="C:\Program Files\webshpere"></Installation>   
</InstallationManagement>

请帮助静默安装 websphere 或交互安装窗口的界面。

标签: windowspowershellscriptingibm-mq

解决方案


推荐阅读