PSVirtualDesktop icon indicating copy to clipboard operation
PSVirtualDesktop copied to clipboard

Throwing errors on latest Win 11 Insider builds

Open kilasuit opened this issue 1 year ago • 23 comments

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

image

kilasuit avatar Jan 23 '24 05:01 kilasuit

image

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

Lifailon avatar Jan 23 '24 10:01 Lifailon

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

MScholtes avatar Jan 24 '24 17:01 MScholtes

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.

ysdev avatar Jan 26 '24 07:01 ysdev

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

MScholtes avatar Jan 28 '24 16:01 MScholtes

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

MarekGrossman avatar Feb 05 '24 06:02 MarekGrossman

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

MScholtes avatar Feb 05 '24 15:02 MScholtes

just some updates. these two machines passed image image

this one did not. image image

image

chrisloup avatar Feb 06 '24 06:02 chrisloup

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 avatar Feb 06 '24 16:02 MScholtes

@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:

kilasuit avatar Feb 06 '24 17:02 kilasuit

@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

MarekGrossman avatar Feb 07 '24 06:02 MarekGrossman

I confirmed VirtualDesktop3085.ps1 working on Windows 11 23H2 22631.3155, the monthly update which came today. Thank you for your help.

ysdev avatar Feb 13 '24 18:02 ysdev

@MScholtes

sry for the delay. was on holiday.

working machine 1 (22h2 22621.3085) image

working machine 2 (23h2 22631.3155) image

Non Working Machine (22h2 22621.3155) image

image image

chrisloup avatar Feb 15 '24 05:02 chrisloup

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

MScholtes avatar Feb 15 '24 08:02 MScholtes

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

MScholtes avatar Feb 15 '24 08:02 MScholtes

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.

chrisloup avatar Feb 16 '24 04:02 chrisloup

Great! It's works again. Realy big thanks for this util Markus!

MarekGrossman avatar Feb 16 '24 12:02 MarekGrossman

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

kilasuit avatar Feb 21 '24 18:02 kilasuit

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

MScholtes avatar Feb 22 '24 16:02 MScholtes

Latest version of the module on the Gallery. from winver image image

Error from New-Desktop in PowerShell 7.5.0-preview.1 image

Error from New-Desktop in PowerShell 5.1 image

kilasuit avatar Feb 22 '24 16:02 kilasuit

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 avatar Feb 24 '24 10:02 MScholtes

@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.

igorakkerman avatar Feb 24 '24 10:02 igorakkerman

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

MScholtes avatar Feb 25 '24 16:02 MScholtes

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.

igorakkerman avatar Feb 26 '24 09:02 igorakkerman

Issue solved but of Canary versions, but no support for this version

MScholtes avatar Mar 29 '24 17:03 MScholtes