PSVirtualDesktop icon indicating copy to clipboard operation
PSVirtualDesktop copied to clipboard

The type initializer for 'VirtualDesktop.DesktopManager' threw an exception

Open bostergit opened this issue 2 years ago • 15 comments

Two days ago, my Windows 11 was upgraded to version 23H2. Now I get the following error:

get-desktoplist

Der Typeninitialisierer für "VirtualDesktop.DesktopManager" hat eine Ausnahme verursacht. In C:\Program Files\WindowsPowerShell\Modules\VirtualDesktop\1.5.6\VirtualDesktop.ps1:1227 Zeichen:16

  •     for ($I = 0; $I -lt [VirtualDesktop.Desktop]::Count; $I++)
    
  •                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : OperationStopped: (:) [], TypeInitializationException
    • FullyQualifiedErrorId : System.TypeInitializationException

My Windows Version: Edition Windows 11 Enterprise Version 23H2 Installiert am ‎26.‎11.‎2023 Betriebssystembuild 22631.3085 Leistung Windows Feature Experience Pack 1000.22684.1000.0

bostergit avatar Jan 27 '24 10:01 bostergit

Hello @bostergit,

I can commit the change with Windows 11 and the preview update for Win 11 23H2 (raises build from 3007 to 3085). However, I will wait until the next mandatory update before making any adjustments, otherwise it will no longer work with Windows 11 without this update.

Greetings Markus

MScholtes avatar Jan 28 '24 16:01 MScholtes

hello @MScholtes, any chance of a pre-release with the changes?

yanislavgalyov avatar Jan 29 '24 07:01 yanislavgalyov

@MScholtes just providing some more datapoints . (new-desktop crashes on exception)

windows 11 22h2 os build 22621.3085 psversion 5.1.22621.2506 windows version 10.0.22621.0

image image

windows 11 23h2 os build 22631.3085 psversion 5.1.22621.2506 windows version 10.0.22631

image image

chrisloup avatar Jan 30 '24 09:01 chrisloup

Same for me. Just want to say thanks for providing these tools, really handy.

Windows 11 Pro 23H2 22631.3085 Windows Feature Experience Pack 1000.22684.1000.0

bedalus avatar Feb 02 '24 08:02 bedalus

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

Hello,

thanks. This worked for me. :)

bostergit avatar Feb 05 '24 18:02 bostergit

Works for me. Thanks

Windows 11 Pro 23H2 22631.3085 Windows Feature Experience Pack 1000.22684.1000.0

yanislavgalyov avatar Feb 06 '24 08:02 yanislavgalyov

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

Worked for me too. Thanks.

Edit : After some uses (during development) it stopped again with the same error.

WilliansDutra avatar Feb 12 '24 13:02 WilliansDutra

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

works well

alex-nikitin-dev avatar Feb 14 '24 20:02 alex-nikitin-dev

Yesterday's monthly mandatory Win 11 updates included the interface changes that break DesktopManager. I'm on Win11 23H2 build 22631.3007.

I just tested VirtualDesktop3085.ps1 and it's working great with my commands. Looking forward to a released version. Thanks for all your work on this!

gopsmith avatar Feb 14 '24 21:02 gopsmith

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

I updated this repository today and the package on PowerShell Gallery.

Awesome, works great. Thanks so much, Markus!

gopsmith avatar Feb 15 '24 14:02 gopsmith

issue

Installed 1.5.7 but to no luck.

michael-akkermans avatar Feb 16 '24 13:02 michael-akkermans

Hello @michael-akkermans,

please install the current February Windows Patch, this will raise your Windows version to 22621.3155 and version 1.5.7 of PSVirtualDesktop (I hope) will work. I still have no feedback if there are additional issues with Win 11 22H2.

If you want to wait some days with patching (not recommended), use the older version 1.5.6 of PSVirtualDesktop.

Greetings

Markus

MScholtes avatar Feb 16 '24 16:02 MScholtes

Hi @MScholtes,

Indeed it works with the current February Windows Patch. Thanks for the feedback.

michael-akkermans avatar Feb 16 '24 20:02 michael-akkermans

Issue solved

MScholtes avatar Mar 29 '24 17:03 MScholtes