Shutting down Docker Desktop on Windows 10 programmatically

Hi, quick question: Does anyone on Windows have experience with starting and (gracefully) stopping Docker Desktop via the command line?
I can start it in PowerShell with Start-Process 'C:\Program Files\Docker\Docker\Docker Desktop.exe' just fine, but so far the only way I found to stop it is with Stop-Process -Name 'Docker Desktop' , which just outright kills Docker Desktop. It works, but I’d prefer a graceful shutdown like you get when choosing ‘Quit Docker Desktop’ from the task icon context menu. Any ideas?

TASKKILL.exe /f /IM “Docker Desktop.exe” /T

The command TASKKILL.exe /f /IM “Docker Desktop.exe” /T is indeed a way to stop Docker Desktop, but it’s not a graceful shutdown. It forcefully terminates the Docker Desktop process and all its child processes, which might lead to data loss or corruption if there are ongoing operations.

A graceful shutdown is one where the process is given the opportunity to clean up resources, finish ongoing tasks, and exit as intended. Unfortunately, as of now, there doesn’t seem to be a built-in command line option for a graceful shutdown of Docker Desktop on Windows.

The ‘Quit Docker Desktop’ option from the task icon context menu does perform a graceful shutdown, but it’s not accessible via the command line.