Updating Windows Subsystem for Linux (WSL2)

Good Morining,

We are attempting to create custom content to update WSL2 on our Windows endpoints to version 2.5.10.0. In theory, this should be fairly simple, as you just need to run “wsl --update” from PowerShell on the affected systems, but I’m trying to confirm the version before/after update by outputting “wsl --version” to a text file. That proved to be more difficult than it sounds, but I think I figured it out.

Right now the fixlet is getting stuck at the “Continue If” statement in the ActionScript on systems where it should return True, and I am not sure why.

Also, even though the PowerShell script to create the text file runs successfully, no text file is present on the target system.

I have attached our content as a .BES. There shouldn’t be any identifying information in there. And I have attached a screenshot of the results from a test run. Please review and let us know if you have any suggestions.

I greatly appreciate any assistance or insight.

Thank you!
_MattG

Windows Susbsytem for Linux (WSL2) _ 2.5.10.0 _ Update.bes (3.8 KB)

Could you not check the version of the service as a basis of applicability instead of depending on a string in a file created I presume by a sperate process? Hopefully that way your fixlet is only going to run on devices with a version lower than the one you want to update to.

Q: version of service "WSLService"
A: 2.5.10.0
T: 158.970 ms
I: singular version

Q: exists service "WSLService" whose (version of it < "2.5.10.0")
A: False
T: 158.533 ms
I: singular boolean
4 Likes

Interesting thought. I had no idea that the service version would be accurate. I will give that a try and let you know the results.

Thank you!

@SLB Thanks again. The relevance does indeed work as intended.

The deployment failed this time, but I think that is because I was not quoting the PowerShell commands, like so:

waithidden "{parameter "powerShellExe"}" -Command "wsl --update"

Waiting for more test systems to become available before we can try again.

1 Like