I have setup an OpenSSH server on a Windows 2022 machine with key based authentication. It works, I can connect from a client using: ssh myuser@server.tld
Unfortunately, OpenSSH uses cmd as the default shell, I am more used to Powershell (core) these days. I used the solution from this question and pointed the DefaultShell registry key to the Powershell executable and restarted the SSH server with Restart-Service sshd.
However, then my connection no longer works. ssh myuser@server.tld results in:
myuser@server.tld: Permission denied (publickey)
Nothing has changed in terms of public/private keys. As soon as I remove the DefaultShell key again, the connection works (and connects to the cmd shell).
How can I connect over SSH and use my existing public/private key pair?

