PSVirtualDesktop
PSVirtualDesktop copied to clipboard
Throwing errors on latest Win 11 Insider builds
Just tried installing and using this module both in Windows PowerShell and the latest PowerShell Daily build and getting these errors
Exact build of windows is 10.0.26020.1000
PSVersion 5.1.19041.3930 BuildVersion 10.0.19041.3930
PS C:\Users\lifailon> Get-DesktopCount 4 PS C:\Users\lifailon> New-Desktop IsVisible Left Right
False VirtualDesktop.Desktop
PS C:\Users\lifailon> Get-DesktopCount 5
Hello, it seems that Microsoft has changed the API again, at least in the Dev Channel. I don't have a clear picture yet if other Insider channels are also affected, but I'm sorry to say that I'm not able to keep up with the Windows Insider changes.
Greetings
Markus
This change also appeared on KB5034204, the preview update of this month(e.g. 10.0.22631.3085 for Windows 11 23H2). Could you confirm it? It might also be included in a security patch on next month.
Hallo,
as much as I can evaluate and others are reporting, Microsoft did change the API for virtual desktops for Windows 11 with the preview update and for the Windows Insider channels. @kilasuit: seems you are using insider canary channel. Sorry, I do not know anything about the changes here.
Greetings
Markus
Hello Markus, I also think that the problem appeared after the KB5034204 was installed. I am not in any Windows insider channels. Do You have any idea how solve the problem? I am using 13 VD and it is very annoying to switche them without your utility.
Thanks
Mareg
Hello all,
I uploaded a test release for Windows 11 23H2 3805. You can try it out the following way:
- download VirtualDesktop3085.ps1 from the root of this repository
- start Powershell in the same directory as the script
- execute
. .\VirtualDesktop3085.ps1
- test your commands for virtual desktops
I did successfully test with a Win11 23H2 3085, but I do not have Win11 22H2 3085 oder Win11 Insider. I would be very happy if someone could test this.
Greetings
Markus
just some updates.
these two machines passed
this one did not.
Hello @chrisloup,
thank you for your feedback.
Unfortunately, Powershell only gives partial or misleading information about the Windows version. Can you run winver.exe or "cmd.exe /c ver" on the three machines to determine the correct Windows version?
Greetings
Markus
@MScholtes this seems to be working for me :-) - tested this in on current Insider Canary build which is 26040.1000
Though will check this again later on in the week when the next build is released later this week
Hello all,
I uploaded a test release for Windows 11 23H2 3805. You can try it out the following way:
@MScholtes it is work well, thanks, but just in one session, how I show install it in whole system? Do You update repository and after this we should install new version? Again thanks for help and utility.
Mareg
I confirmed VirtualDesktop3085.ps1 working on Windows 11 23H2 22631.3155, the monthly update which came today.
Thank you for your help.
@MScholtes
sry for the delay. was on holiday.
working machine 1 (22h2 22621.3085)
working machine 2 (23h2 22631.3155)
Non Working Machine (22h2 22621.3155)
Hello @chrisloup, thank you for your feedback, but to use the example version manually, you have to dotsource the script:
. .\VirtualDesktop3085.ps1
(the leading . is important)
Greetings
Markus
Hello,
I updated this repository today and the package on PowerShell Gallery. With
Update-Module VirtualDesktop
or
Install-Module VirtualDesktop
you can install the new version 1.5.7.
I do still have no feedback to Windows 11 22H2 with the new patch. If someone would report I would be very thankful.
Greetings
Markus
Hello @chrisloup, thank you for your feedback, but to use the example version manually, you have to dotsource the script:
. .\VirtualDesktop3085.ps1(the leading . is important)
Greetings
Markus
thanks. yes. that same pc I updated with 1.5.7 works as well. so all good at my end.
Great! It's works again. Realy big thanks for this util Markus!
I haven't tested all the cmdlets but some are working & others are throwing errors or crashing the powershell process.
Seem to be working
Switch-Desktop
Pin-Window
Unpin-Window
Crashed PowerShell
New-Desktop
Didn't update properly
Set-DesktopName
Hello @kilasuit,
please post the Windows version you are using (output of WinVer.exe). Which version of the Virtual Desktop module you are using?
Greetings
Markus
Latest version of the module on the Gallery.
from winver
Error from New-Desktop in PowerShell 7.5.0-preview.1
Error from New-Desktop in PowerShell 5.1
Hello @kilasuit,
it is sad to hear that the changes are not working for the Canary Insider channel. Unfortunately, due to the effort involved, I can't provide support here - especially not for Canary, which is constantly undergoing major changes that are often not incorporated into the other versions.
I have adapted the description on the readme page
Greetings
Markus
@MScholtes Thank you for your great work.
When Microsoft makes breaking changes to the Windows APIs or the OS behavior, do they publish a list of those changes and the steps to adapt your applications? I didn't dig into the internals to understand how your application works and whether there actually are official API's for what it does.
Hello @igorakkerman,
Microsoft does not publish any documentation on the interfaces for virtual desktops, as it believes that these functions should only be set by the user.
With every new version, build or monthly patch, there is therefore a risk that COM GUIDs will change or function calls to the API will change. This must be determined by debugging the API, and this for each Windows version individually, as the APIs usually differ between the versions (i.e. for Win10 22H2, Win 10 23H2, Win 11 22H2, Win 11 23H2, Win 11 Insider Beta and Preview and Dev and Canary, also Windows Server [fortunately there are significantly fewer versions]).
So only the community can provide the necessary information, fortunately there are very active helpers. However, there is always the danger that Microsoft will make this impossible.
Greetings
Markus
Thank you, @MScholtes, for explaining and for your great reverse-engineering work. It is a pity that Microsoft still doesn't open all Windows APIs, but I don't want to open a more extensive discussion here.
Issue solved but of Canary versions, but no support for this version