Answer the question
In order to leave comments, you need to log in
How to call a script with an argument in powershell?
Good day!
Wrote a bash script
start) {
бла-бла
}
stop) {
бла-бла
}
restart) {
бла-бла
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
Answer the question
In order to leave comments, you need to log in
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True,Position=1)]
[String]$worktype
)
switch ($worktype) {
'start' {
Write-Host 'start'
}
'stop' {
Write-Host 'stop'
}
'restart' {
Write-Host 'restart'
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question