Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Powershell Date and Echo

$
0
0

Hello,

I am trying to echo the date to a file so i can basically just record the last day the script was ran.  I do not what the exact time, but just i am happy with dates.

Anyways i simply do this:

$DATE = get-date -DisplayHint date

echo $DATE >> backupdate.txt

However when looking at the file it outputs a blank line before and 3 blank lines after. I simply want the script to write the date on a new line.  so the 3 blank lines afterwards is a bit excessive.  So i just want this in the file

Monday, February 10, 2014
Monday, February 11, 2014
Monday, February 12, 2014

How can i fix this formatting issue? 



Viewing all articles
Browse latest Browse all 15028

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>