I am using following command to create a task in task scheduler on Windows Server 2019. It works fine.
But when I try to run the same command in Docker then it throws error. I am using this command in Dockerfile so build image always fails due to it.
Here's my Dockerfile:
FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2019
RUN mkdir /StudentManagementSystemConsole
COPY ./Release /StudentManagementSystemConsole
RUN schtasks /create /sc minute /mo 1 /tn "Student Management System" /tr "C:\StudentManagementSystemConsole\StudentManagementSystemConsole.exe"
Error I am getting is:
ERROR: Invalid argument/option - 'Management'.
Type "SCHTASKS /CREATE /?" for usage.
How do I fix this issue?