I have the need to mark the time in some logs that are created by powershell scripts. I use
$date = get-date
The first time the $date variable is used, the date is correct. Iterations following all have the same date. How can I clear the $date variable so that every time I call it, the current date is used?
clear-variable $date shows error shown:
Clear-Variable : Cannot find a variable with name '03/28/2014 17:19:13'.