'shell-command never returns in emacs lisp

I am trying to write a function to send the clipped image in windows host to my Ubuntu WSL2

    (defun win2wsl-clipped-image()
      "use powershell to save the clipped image to wsl and load it to xclip"
      (interactive)
      (let* ((powershell "/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe")
             (file-name "//wsl$/Ubuntu/home/username/tmp/clip_win2wsl.png")
             (file-name-wsl "~/tmp/clip_win2wsl.png"))
        (shell-command (concat powershell " -command \"(Get-Clipboard -Format Image).Save(\\\"" file-name "\\\")\""))
        (shell-command (concat "xclip -selection clipboard -t image/png -i " file-name-wsl))))

but the second invocation of shell-command never returns. I get a message saying: Waiting for process to die..., and I have to C-g to quit. If I print out the same concatenated command and run it in my shell, everything works, it finishes immediately... any idea why is that?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source