I need to Stop the service, and once the service is stopped i need to reboot the system. After the reboot i need to start the service if it is in stopped state using powershell script.
$stage= get-service -name "chrome"
if ( $stage.Status -eq "Running" )
{
Write-Host "The service " $stage.Name "is running"
Stop-Service -Name 'chrome'
}
if ( $stage.Status -eq "Stopped")
{
Restart-Computer -Wait
Start-Service 'chrome'
}