Enable-PSRemoting -SkipNetworkProfileCheck -Force
Remove-Item -Path WSMan:\Localhost\listener\listener* -Recurse;
New-Item -Path WSMan:\LocalHost\Listener `
-Transport HTTPS `
-Address * `
-CertificateThumbPrint `
(New-SelfSignedCertificate `
-CertstoreLocation Cert:\LocalMachine\My `
-DnsName $env:computername `
-NotAfter (get-date).AddYears(6)).Thumbprint `
-Force
New-NetFirewallRule -DisplayName 'WinRM HTTPS' `
-Name 'WinRM_HTTPS' `
-Profile Any `
-LocalPort 5986 `
-Protocol TCP `
-RemoteAddress 127.0.0.1
Get-NetFirewallRule -DisplayGroup 'File and Printer Sharing' | Set-NetFirewallRule -Profile 'Private, Domain' -Enabled true
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart