I'am trying to use the return string from the function as file name for the downloaded file as timestamp. I'm not shure, why is does not work. Can you help me please?
Thank you!
Push-Location $(Split-Path $Script:MyInvocation.MyCommand.Path)
Invoke-WebRequest https://chartership.eu/images/preislisten/CS-Preis-Belegung.xlsx.pdf -Outfile Get-TimeStamp
function Get-TimeStamp {
return "[{0:MM/dd/yy} {0:HH:mm:ss}].pdf" -f (Get-Date)
}