使用脚本在 Microsoft Windows Server 上更新 Automation 360

您可以使用带有参数的自定义脚本来更新 Automation 360,以维持现有用户配置。

先决条件

要执行此任务,您必须拥有具有所需权限和许可的 Control Room 管理员账户。

示例 config.properties 文件: 作为参考,您可以在页面末尾找到一个示例 config.properties 文件。
注: 要获取有关单独执行 Automation 360 的静默安装和配置的说明,请参阅 Silent installation and configuration of Automation 360 using scripts (A-People login required)
注:Microsoft Windows Server 上安装 Control Room 时使用的各种参数适用于在 Microsoft Windows Server 上更新 Automation 360。 有关更多信息,请参阅 使用脚本在 Microsoft Windows Server 上安装 Control Room

创建并运行 PowerShell 脚本以更新 Automation 360

过程

  1. 创建具有必需参数的 PowerShell 脚本:
    以下是用于升级 Automation 360 的 PowerShell 脚本示例:
    # Script Begins
    # It fetches Data from config.properties file present under the same directory level
    
    $PropertyFilePath = 'C:\script\config.properties'
    $rawProperties = cat $PropertyFilePath
    $propertiesToConvert = ($rawProperties -replace '\\' ,'\\') -join
    [Environment]:: NewLine;
    $properties=ConvertFrom-StringData $propertiesToConvert
    $env:SEE_MASK_NOZONECHECKS = 1
    
    # Setting up the logger and InstallerRoot Directory
    
    $baseLogFilePath=$properties.baseLoggingDirectory
    $logFilePath=$baseLogFilePath+'Express_CR_Installation_Scenario1.txt'
    $baseInstallerPath=$properties.baseInstallerDirectory
    $installer_name_regex=$properties.installerNameRegex
    
    # Logging Begins
    
    Start-Transcript -Path $logFilePath -Append -IncludeInvocationHeader
    
    $binary = Get-ChildItem $baseInstallerPath | Where-Object { $_.FullName -imatch $installer_name_regex }
    $a = $binary.FullName
    $final_commandline = " /update /s /v/qn /v""/L*v CR_Onprem_Installationlog_Scenario1.txt"""
    
    # Recording the Start Time
    Get-Date -Format g
    
    # Invoking the Installer here
    $processdetail = (Start-Process -FilePath $a -ArgumentList $final_commandline -Wait -Passthru).ExitCode
    
    # Recording the End  Time
    Get-Date -Format g
    
    
    Stop-Transcript
    
  2. 可选: 根据您的要求,自定义脚本以包含参数。
  3. 将脚本保存到安装服务器。
  4. 以管理员身份登录到安装服务器。
  5. 在管理员模式下启动 PowerShell。
  6. 运行以下命令:
    Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
    .\install.ps1
    注: 静默安装日志存储在运行安装脚本的文件夹中。 例如,如果从 C:\Silent Install 运行脚本,则日志会存储在 C:\Silent Install 文件夹中。
  7. 验证以下内容:
示例 config.properties 文件
# Properties utilized across all Scenarios

# Default/Express Mode Params

baseLoggingDirectory=C:\script\logs\
baseInstallerDirectory=C:\script\
installerName=Automation360.exe
注: 查看示例 config.properties 文件中的以下属性:
  • baseLoggingDirectory - 所有配置日志的目录。
  • baseInstallerDirectory - 是安装目录。 例如,C:\\Users\\prod\\Downloads\\Automation360\\Automation360.exe.
  • installerName - 安装程序的名称。