From cfa87fc674dccd0b56bff314743b00eec9812a0e Mon Sep 17 00:00:00 2001 From: David Yoder Date: Thu, 5 Oct 2023 17:04:53 -0400 Subject: [PATCH] removed for later rework --- Upload-Data.ps1 | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 Upload-Data.ps1 diff --git a/Upload-Data.ps1 b/Upload-Data.ps1 deleted file mode 100644 index 13a8e64..0000000 --- a/Upload-Data.ps1 +++ /dev/null @@ -1,39 +0,0 @@ -If ( $LFCLI ) { - - ## Create the path to $FileToUpload and zip the specified directory if necessary - If ( $(Get-Item $DataToUpload) -is [System.IO.DirectoryInfo] ) { - $FileToUpload = '{0}\{1}.zip' -f $Global:OutputDirectory,$(Split-Path -Leaf $DataToUpload) - Zip-Object -path $DataToUpload -dest $FileToUpload - $DeleteAfterUpload = $true - } - Else { - $FileToUpload = $DataToUpload - $DeleteAfterUpload = $false - } - - Install-PSAteraModule - Import-Module -Name PSAtera - Set-AteraAPIKey -APIKey $AteraAPIKey - $LFHost = $(Get-AteraCustomValue -ObjectType Customer -ObjectId 9 -FieldName 'LiquidFiles Host URL').ValueAsString - $FiledropURL = "${LFHost}/filedrop/cmd" - - ## Set the message properties for the file upload - $From = '{0}@{1}.net' -f $Env:COMPUTERNAME,$($Global:MSPName -replace " ","").ToLower() - $Subject = [System.IO.Path]::GetFileNameWithoutExtension($FileToUpload) - $Message = "" - - If ( Test-Path $FileToUpload ) { - Write-Output "Uploading ""${FileToUpload}""" - - If ( $DeleteAfterUpload ) { - Try { Start-Process "${LFCLI}" -ArgumentList "filedrop /url:${FiledropURL} /from:""${From}"" /subject:""${Subject}"" /msg:""${Message}"" /c:n /deleteAfterUpload /f:""${FileToUpload}""" -Wait } - Catch { Write-Error $_.Exception.Message } - } - Else { - Try { Start-Process "${LFCLI}" -ArgumentList "filedrop /url:${FiledropURL} /from:""${From}"" /subject:""${Subject}"" /msg:""${Message}"" /c:n /f:""${FileToUpload}""" -Wait } - Catch { Write-Error $_.Exception.Message } - } - } - Else { Write-Output "The specified file does not exist: ""${FileToUpload}""" } -} -Else { Write-Output "Could not upload any data because the LiquidFiles CLI tool was not found" }