starting/stopping a service in windows with the powershell

The powershell is a very good replacment of the cmd.exe. It has a bunch of new functions:

To manage services running on windows, you have to start powershell as administrator.

get-service

lists all availalable services.

PS C:\dev\Tools> Get-Service *oracle*

Status   Name               DisplayName
------   ----               -----------
Stopped  OracleJobSchedu... OracleJobSchedulerXE
Stopped  OracleMTSRecove... OracleMTSRecoveryService
Running  OracleServiceXE    OracleServiceXE
Stopped  OracleXEClrAgent   OracleXEClrAgent

Running  OracleXETNSList... OracleXETNSListener


shows all services with this name.

start-service/stop-service will help you in managing this services.

stop-service OracleServiceXE

will just stop the database :-)

There are also some other commands:

PS C:\dev\Tools> Get-Command | Select-String Service  
                                                      
Get-NetFirewallServiceFilter                          
Set-NetFirewallServiceFilter                          
Get-Service                                           
New-Service                                           
New-WebServiceProxy                                   
Restart-Service                                       
Resume-Service                                        
Set-Service                                           
Start-Service                                         
Stop-Service                                          
Suspend-Service