$restriction_file = "C:\Windows\restrict.txt"
$restrictions = Get-Content -Path $restriction_file
$before = $($restriction[0].Split(":"))[1]
$after = $($restriction[1].Split(":"))[1]
While($true)
{
    If ($(Get-Date).Hour -lt $before)
    {
        shutdown.exe -s -f -t 1
    }
    elseif ($(Get-Date).Hour -gt $after)
    {
        shutdown.exe -s -f -t 1
    }
    else
    {
        Start-Sleep -Seconds 300
    }
}