I've been deploying systems and improving processes for as long as I can remember.
Skills: Kubernetes / Helm / Kustomize / Flux CD / Terraform / Python / PowerShell / Bash
Install WSL2 and handle dependencies
License: BSD 2-Clause "Simplified" License
dev branch install checking for SLES-12 is not working (check appx matching)
Need to determine if WSL kernel component update is already installed, so we don't re-install with every run.
While selecting a package where URI is not available, the Get-StoreDownloadLink
function fails because $newHtml.write($src)
does not work. I couldn't dig deep into the "why it doesn't work" but found this StackOverflow answer to be helpful.
Proposed fix -
Additional debugging details -
PS C:\Windows\system32> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.19041.610
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.610
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Here's what the log looks like -
+------------------------------------------------+
| Choose your Distro |
| Ubuntu 18.04 is recommended for Docker on WSL2 |
+------------------------------------------------+
1 Ubuntu 20.04
2 Ubuntu 18.04
3 Ubuntu 16.04
4 Debian
5 Kali
6 OpenSUSE Leap 42
7 SUSE Linux Enterprise Server 12
8 Alpine
>: 1
...Downloading Ubuntu 20.04.
Exception calling "write" with "1" argument(s): "Type mismatch.
"
At line:95 char:5
+ $newHtml.write($src)
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : COMException
Invoke-WebRequest : Cannot validate argument on parameter 'Uri'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
At line:225 char:32
+ Invoke-WebRequest -Uri $distro.URI -OutFile $Filename -UseBas ...
+ ~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Invoke-WebRequest], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
...Beginning Ubuntu 20.04 install.
Add-AppxPackage : Cannot find path 'C:\Windows\system32\CanonicalGroupLimited.Ubuntu20.04onWindows.appx' because it does not exist.
At line:227 char:9
+ Add-AppxPackage -Path $Filename
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\Windows\syst...4onWindows.appx:String) [Add-AppxPackage], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand
Start-Process : This command cannot be run due to the error: The system cannot find the file specified.
At line:261 char:9
+ Start-Process $distro.winpe
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
Have you thought about supporting other Distros than Ubuntu. E.g. Debian.
I kind of have trouble finding the "installer link" in microsofts docs.
First part of the script seems to work OK, however after reboot and rerun it can't obtain the appx files from the store:
`
Exception calling "write" with "1" argument(s): "Type mismatch.
"
At line:95 char:5
$newHtml.write($src)
~~~~~~~~~~~~~~~~~~~~
Invoke-WebRequest : Cannot validate argument on parameter 'Uri'. The argument is null or empty. Provide an argument
that is not null or empty, and then try the command again.
At line:225 char:32
Invoke-WebRequest -Uri $distro.URI -OutFile $Filename -UseBas ...
~~~~~~~~~~~
URIs for Alpine and Ubuntu 20.04 expire, will need to post/parse and get fresh links when installing those distros.
Create new function to handle Windows Store links and return a fresh download URI.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.