This is the command you need to put your computer to automatically sleep at a certain interval that you want: I had to do this to limi some family time for my kids and it worked, not sure whats your reason, but this is the powershell command you need:

 

> $s = 2700; while($s -gt 0) { Write-Progress -Activity "Sleeping in..." -Status "$s seconds remaining" -SecondsRemaining $s; Start-Sleep 1; $s-- }; rundll32.exe powrprof.dll,SetSuspendState 0,1,0