I try to explain little more clearly.
I have a Script with diferent function:
Function StopLAGOServvices {
}
Function StartLAGOServices {
}
Function CleanTempfolder {
}
Function TestWebservices {
}
Function RestartLAGOServices {
StopLAGOServvices
StartLAGOServices
CleanTempfolder
TestWebservices
}
Function UpdateLAGOServices {
}
I want to can define parameter with switch, something this:
Param(
[Parameter(Mandatory=$True)]
[string]$StringParameter
)
Switch ( $Param )
{
Start { Function StartLAGOServices }
Stop { … }
Restart { … }
Clean { … }
Update { … }
}
I want to start script with task shedule for example 00:30 with option start "function startlago..." oder stop "function stoplago.."
Another option is to use 5 different scripts and when I select the appropriate parameter to run the corresponding script - restartlago.sp1
Param(
[Parameter(Mandatory=$True)]
[string]$StringParameter
)
Switch ( $Param )
{if ($Param -like Start) {
start startlago.ps1
}
elseif ($Param -like Stop) {
start stoplagp.ps1
}
elseif ($Param -like Clean) {
start cleanfolder.ps1
}
}
When i set up the task in shedule task i need to specife the right command. For example: execute the script restartlgo.sp1 with option start at 23:00 and script execute "start startlago.ps1". When i want to setup execute the script restartlgo.sp1 with option stop at 23:00 and script execute "stop stoplago.ps1".
I hope this explanation is clearer.
Thank you advance all of yours!