I wannt to move a window between desktops. Something like this:
$app = Start-Process notepad.exe -PassThru
sleep 1
$hndl = $app.MainWindowHandle
# Move notepad window to desktop №2
[DesktopManager]::MoveToDesktop($hndl, 2) # True
# Get the number of desktop, where the app is located now
[DesktopManager]::GetDesktopWindow($hndl) # 2
#etc...
I have found this and this, but I don't understand how to run it via PowerShell.
Also i have found this...