#ps1 # 1. Download the installation package $url = "https://aom-uniagent-cn-north-4.obs.cn-north-4.myhuaweicloud.com/uniagentd-1.1.5-win32.zip" $downloadPath = "C:\uniagentd-1.1.5-win32.zip" Invoke-WebRequest -Uri $url -OutFile $downloadPath # 2. Unzip and install $unzipDir = "C:\uniagentUnzip" $msiPath = "$unzipDir\uniagentd-1.1.5-win32\uniagentd.msi" Expand-Archive -Path $downloadPath -DestinationPath $unzipDir Start-Process msiexec.exe -ArgumentList "/i `"$msiPath`"" -Wait # 3. Modify the configuration file $confFile = "C:\uniagentd\conf\uniagentd.conf" $config = @" master=https://aom-mgr-lb.cn-north-4.myhuaweicloud.com:33552,https://100.125.12.110:33552 project_id=073578856a8026a42f2ac0107c0a17f4 public_net=false "@ Set-Content -Path $confFile -Value $config # 4. Start the program Start-Process -FilePath "C:\uniagentd\bin\start.bat" -Verb RunAs # 5. Delete download package and unzip directory Remove-Item -Path $downloadPath -Force Remove-Item -Path $unzipDir -Recurse -Force