Use older webclient for compatibility
This commit is contained in:
parent
0601036fd5
commit
1b91c295e9
@ -1,9 +1,14 @@
|
||||
#!ps
|
||||
#timeout=3000000
|
||||
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls -bor [Net.SecurityProtocolType]::Tls11 -bor [Net.SecurityProtocolType]::Tls12
|
||||
|
||||
$PackagePath = 'C:\Packages'
|
||||
|
||||
$ServerUrl = 'https://automate.example.com'
|
||||
$ServerPass = ''
|
||||
$LocationId = ''
|
||||
|
||||
$PackagePath = 'C:\Packages'
|
||||
|
||||
$AgentInstallFile = 'LabTechRemoteAgent.msi'
|
||||
$AgentInstallUrl = "$ServerUrl/LabTech/Service/$AgentInstallFile"
|
||||
$AgentInstallPath = Join-Path -Path $PackagePath -ChildPath $AgentInstallFile
|
||||
@ -13,7 +18,7 @@ If (!(Test-Path -PathType Container $PackagePath)) {
|
||||
}
|
||||
|
||||
Write-Host "Downloading Agent Installer..."
|
||||
Invoke-WebRequest -Uri $AgentInstallUrl -OutFile $AgentInstallerPath -UseBasicParsing
|
||||
(New-Object Net.WebClient).DownloadFile($AgentInstallUrl, $AgentInstallPath)
|
||||
Write-Host "Starting installation..."
|
||||
msiexec.exe /i "$AgentInstallPath" /q /lv "$(Join-Path -Path $PackagePath -ChildPath $AgentInstallFile).log" SERVERADDRESS="$ServerAddress" SERVERPASS="$ServerPass" LOCATION="$LocationId"
|
||||
Write-Host "Log saved at $(Join-Path -Path $PackagePath -ChildPath $AgentInstallFile).log"
|
||||
msiexec.exe /i "$AgentInstallPath" /q /lv "$($AgentInstallPath).log" SERVERADDRESS="$ServerUrl" SERVERPASS="$ServerPass" LOCATION="$LocationId"
|
||||
Write-Host "Log saved at $($AgentInstallPath).log"
|
@ -1,7 +1,12 @@
|
||||
#!ps
|
||||
#timeout=3000000
|
||||
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls -bor [Net.SecurityProtocolType]::Tls11 -bor [Net.SecurityProtocolType]::Tls12
|
||||
|
||||
$PackagePath = 'C:\Packages'
|
||||
|
||||
$AgentUninstallFile = 'Agent_Uninstaller.zip'
|
||||
$AgentUninstallUri = "https://s3.amazonaws.com/assets-cp/assets/$AgentUninstallFile"
|
||||
$AgentUninstallUrl = "https://s3.amazonaws.com/assets-cp/assets/$AgentUninstallFile"
|
||||
$AgentUninstallPath = Join-Path -Path $PackagePath -ChildPath $AgentUninstallFile
|
||||
|
||||
If (!(Test-Path -PathType Container $PackagePath)) {
|
||||
@ -9,7 +14,7 @@ If (!(Test-Path -PathType Container $PackagePath)) {
|
||||
}
|
||||
|
||||
Write-Host "Downloading Agent Uninstaller..."
|
||||
Invoke-WebRequest -Uri $AgentUninstallUri -OutFile $AgentUninstallPath
|
||||
(New-Object Net.WebClient).DownloadFile($AgentUninstallUrl, $AgentUninstallPath)
|
||||
Write-Host "Expanding Agent Uninstaller..."
|
||||
Expand-Archive -Path $AgentUninstallPath -DestinationPath $PackagePath -Force
|
||||
Write-Host "Invoking Agent Uninstaller..."
|
||||
|
Loading…
x
Reference in New Issue
Block a user