问题 Have a powershell script that will create a scheduled task, for deployment, by way of Octopus, to a Windows 2012 server. Function Create-ScheduledTask($TaskName,$RunAsUser,$TaskRun,$Schedule,$StartTime,$StartDate,$Arguments,$RunWithElevatedPermissions,$Days,$Password){ # set up $Command = "schtasks.exe /create /ru `"$RunAsUser`" /tn `"$TaskName`" /tr `"'$($TaskRun)' $Arguments`" $cmdSchedule $cmdDays $cmdStartDate $cmdStartTime /F $cmdInterval $cmdDuration $cmdRunLevel $cmdPassword" echo