I would like to have a variable value as “1/14/2013 10:00:00” (including the inverted quotes). Below is the code:
$a = Get-Date
$b = $a.AddDays(-1)
$b = $b.ToShortDateString();
$StartTime = "10:00:00 PM"
$EndTime = "11:00:00 PM"
$before = $b + " " + $StartTime
$after = $b + " " + $EndTime
Upon further research, I found that there is an issue reported by Microsoft. It can be found here
Any idea? Thanks!
If you still need to use variables in your string you can use escaped quotes e.g.: