Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

tommy.sharp.prolorus

Thanks Martin!
martin

Re: Log short filename of uploaded file instead of full path?

Use Split-Path:
$nameonly = Split-Path $transfer.FileName -leaf
FN_LogWrite "     Upload of $nameonly succeeded"

See https://stackoverflow.com/q/35813186/850848
tommy.sharp.prolorus

Log short filename of uploaded file instead of full path?

I am using Powershell to upload files to a SFTP server and am using some example code found in the forums to log the upload of each file. Currently it logs the full path of the file, is there any way to just log the file name and not the folder it is in?

# Log Results
foreach ($transfer in $transferResult.Transfers)
{
  FN_LogWrite "     Upload of $($transfer.FileName) succeeded"
}