I have a basic FTP upload PowerShell code that I run (hidden) via VBA in Excel:
VBA:
Call Shell("powershell -executionpolicy bypass & """ & ThisWorkbook.Path & "\FTP\FTPUpload.ps1""", vbHide)
FTPUpload.ps1:
$File = "H:\Workbook\file.txt"
$ftp ="ftp://user:pass@ftp.site.org/incoming/file.txt"
"ftp url: $ftp"
$webclient = New-Object System.Net.WebClient
$uri = New-Object System.Uri($ftp)
"Uploading $File..."
$webclient.UploadFile($uri, $File)
I want to be able to display a pass/fail message to the user. What is the best way to do this?