That's weird that it works when pasted to the powershell console, but not in
the script, is it a bug? Anyway, the reason I added that, is because a blank
line gets displayed before the time spans the first time the script runs
"Kiron" <Kiron@xxxxxx> wrote in message
> The problem is an outstream quirk that starts in this line:
> $NextYearDate - ([datetime]::now)
> When the output -in the form of a Format-List- is merged with
> Format-Table's output, the script breaks.
> To fix it pipe the output from that lne to Out-Default.
> # pipe the output to Out-Default
> $NextYearDate - ([datetime]::now) | Out-Default
> # or suppress it, since it's wiped by the cls statement anyway
> $NextYearDate - ([datetime]::now) | Out-Null