Need help!

by derbosewicht at 2013-05-02 12:13:39

Create PowerShell Script
Accepts 2 variables
Variable #1: Service Name
Variable #2: Action (Start, Stop, or Restart)
When script is called it runs the chosen action against the chosen service

Thats is what I’m trying to accomplish!(newbee to ps fyi!) Thanks in advance!
by mjolinor at 2013-05-02 12:16:31
Homework assignment?
by derbosewicht at 2013-05-02 12:20:19
I’m not in school :slight_smile:
by derbosewicht at 2013-05-02 12:37:19
by ArtB0514 at 2013-05-02 12:50:08
Suggest that you start with Get-Help. Start with Get-Help about_Functions* to get the list of function creation help and with Get-Help service to get the list of service functions. Here’s a list to get you a bit of a leg up:
Get-Help about_Functions
Get-Help about_Functions_Advanced
Get-Help about_Functions_Advanced_Methods
Get-Help about_Functions_Advanced_Parameters
Get-Help about_Functions_CmdletBindingAttribute
Get-Help Get-Service
Get-Help Restart-Service
Get-Help Start-Service
Get-Help Stop-Service