Hi, I'm trying to use Powershell scripting to monitor SQL Server 2008 and I tried the below:
$mydate=get-date
$mydate.year
$mydate.month
$mydate.day
$mydate.day+1
PS C:\> $mydate=get-date
PS C:\> $mydate.year
2011
PS C:\> $mydate.month
2
PS C:\> $mydate.day
28
PS C:\> $mydate.day+1
29
PS C:\>
Here, when I tried the last command $mydate.day+1, it's giving me the result as 29 which does not exist in Feb month. How to resolve this?
I want to see the result as March 1st
Thanks