Team - using the following snippet of code
Export-Csv $destinationpath\$destinationfilename_$(get-date -Format yyyymmdd_hhmmtt).csv -NoTypeInformation
I'm using a variable for the file location ($destinationpath) and another variable for the file name ($destinationfilename) ... and then just adding a timestamp for tracking.
The file will export to the correct location however the file name portion ($destionalfilename) is not included ... just the timestamp. Looks like this in the folder: 20212511_0225PM
I can see the variable stored in PowerShell but it just won't make it into the file name. I've played around with single and double quotes ... spacing and backslashes in the variable names.
Suggestions?