diff --git a/Tools.ps1 b/Tools.ps1 index 1284313..10c365d 100644 --- a/Tools.ps1 +++ b/Tools.ps1 @@ -582,5 +582,26 @@ function Unzip-Object ([Parameter(ValueFromPipeline=$true)][string]$path) { Else { LogMsg "The path specified is not a zip file: ${path}" } } +# Function to get a copy of the LiquidFiles CLI agent +function Get-LiquidFilesCLI { + $url = 'https://lfupdate.s3.amazonaws.com/clients/windows_cli/LiquidFilesCLI-2.0.128.zip' + $zip_filename = Split-Path -Leaf $url + $zip_path = "${Global:ToolsDirectory}\${zip_filename}" + $exe_path = '{0}\{1}.exe' -f $Global:ToolsDirectory,[System.IO.Path]::GetFileNameWithoutExtension($zip_filename) + If ( Test-Path $zip_path ) { + LogMsg "Deleting existing zip archive: ${zip_path}" + Try { Remove-Item -Path $zip_path -Force } + Catch { LogErr $_.Exception.Message } + } + If ( Test-Path $exe_path ) { + LogMsg "Deleting existing file: ${exe_path}" + Try { Remove-Item -Path $exe_path -Force } + Catch { LogErr $_.Exception.Message } + } + Download-File -URL $url -File $zip_path | Out-Null + Unzip-Object $zip_path + Return $exe_path +} + Setup-MSPDirectories Setup-LogFile \ No newline at end of file