Using Cygwin environment on Windows is a very common solution for automation.
I am looking for a script that would automate the cygwin installation and enablement of ssh server.
I could try to write one but one of the problems is that I don't know what I can use to download line for downloading cygwin.
Automating the Cygwin installation is described here. Once you've installed Cygwin, you need to run ssh-host-config to set up the ssh server. I don't know how easy that is to automate, but maybe you could do something with expect, and chain the two scripts together.
FWIW, I created a package called CygSSH that's basically a convenient packaging of the Cygwin version of OpenSSH (server and/or client) and rsync. It's on GitHub:
https://github.com/Bill-Stewart/CygSSH
The
Releases
tab has the installer executable.