# Enter tmp
pushd .local\tmp
- # Remove any leftover tmp cruft
+ # Remove any leftover tmp cruft
Remove-Item -Path ".\foobar-v*" -Recurse -ErrorAction Ignore
Remove-Item -Path ".\foo.exe" -Recurse -ErrorAction Ignore
# Windows BSD-tar handles zip. Imagine that.
echo "Unpacking $pkg_download"
& tar xf "$pkg_download"
-
+
# Settle unpacked archive into place
echo "Install Location: $pkg_src_cmd"
- New-Item "$pkg_src_bin" -ItemType Directory
+ New-Item "$pkg_src_bin" -ItemType Directory -Force
Move-Item -Path ".\foobar-*\foo.exe" -Destination "$pkg_src_bin"
# Exit tmp
# Download the latest webi, then install {{ exename }}
-IF (!(Test-Path -Path .local\bin)) { New-Item -Path .local\bin -ItemType Directory }
+New-Item -Path .local\bin -ItemType Directory -Force
IF ($Env:WEBI_HOST -eq $null -or $Env:WEBI_HOST -eq "") { $Env:WEBI_HOST = "https://webinstall.dev" }
curl.exe -s -A "windows" "$Env:WEBI_HOST/packages/_webi/webi.ps1" -o "$Env:USERPROFILE\.local\bin\webi.ps1"
Set-ExecutionPolicy -Scope Process Bypass
# Make paths if needed
if (!(Test-Path -Path Downloads))
{
- New-Item -Path Downloads -ItemType Directory
+ New-Item -Path Downloads -ItemType Directory -Force
}
if (!(Test-Path -Path .local\bin))
{
- New-Item -Path .local\bin -ItemType Directory
+ New-Item -Path .local\bin -ItemType Directory -Force
}
if (!(Test-Path -Path .local\opt))
{
- New-Item -Path .local\opt -ItemType Directory
+ New-Item -Path .local\opt -ItemType Directory -Force
}
# {{ baseurl }}
pushd $Env:USERPROFILE
# Make paths if needed
-if (!(Test-Path -Path .local\bin))
-{
- New-Item -Path .local\bin -ItemType Directory
-}
-if (!(Test-Path -Path .local\xbin))
-{
- New-Item -Path .local\xbin -ItemType Directory
-}
+New-Item -Path .local\bin -ItemType Directory -Force
+# TODO replace all xbin with opt\bin\
+New-Item -Path .local\xbin -ItemType Directory -Force
+
# See note on Set-ExecutionPolicy above
Set-Content -Path .local\bin\webi.bat -Value "@echo off`r`npushd %USERPROFILE%`r`npowershell -ExecutionPolicy Bypass .local\bin\webi.ps1 %1`r`npopd"
if (!(Test-Path -Path .local\opt))
{
- New-Item -Path .local\opt -ItemType Directory
+ New-Item -Path .local\opt -ItemType Directory -Force
}
# TODO windows version of mktemp -d
if (!(Test-Path -Path .local\tmp))
{
- New-Item -Path .local\tmp -ItemType Directory
+ New-Item -Path .local\tmp -ItemType Directory -Force
}
# TODO SetStrictMode
# Settle unpacked archive into place
echo "Install Location: $pkg_src_cmd"
- New-Item "$pkg_src_bin" -ItemType Directory
+ New-Item "$pkg_src_bin" -ItemType Directory -Force
Move-Item -Path ".\dotenv.exe" -Destination "$pkg_src_bin"
# Exit tmp
}
pkg_install() {
- # $HOME/.local/xbin
+ # $HOME/.local/bin
mkdir -p "$pkg_src_bin"
# mv ./fzf* "$HOME/.local/opt/fzf-v0.21.1/bin/fzf"
# Settle unpacked archive into place
echo "Install Location: $pkg_src_cmd"
- New-Item "$pkg_src_bin" -ItemType Directory
+ New-Item "$pkg_src_bin" -ItemType Directory -Force
Move-Item -Path ".\gitdeploy.exe" -Destination "$pkg_src_bin"
# Exit tmp
# Enter tmp
pushd .local\tmp
- # Remove any leftover tmp cruft
+ # Remove any leftover tmp cruft
Remove-Item -Path ".\goreleaser-v*" -Recurse -ErrorAction Ignore
Remove-Item -Path ".\goreleaser.exe" -Recurse -ErrorAction Ignore
# Settle unpacked archive into place
echo "Install Location: $pkg_src_cmd"
- New-Item "$pkg_src_bin" -ItemType Directory
+ New-Item "$pkg_src_bin" -ItemType Directory -Force
Move-Item -Path ".\goreleaser.exe" -Destination "$pkg_src_bin"
# Exit tmp
# Settle unpacked archive into place
echo "Install Location: $pkg_src_cmd"
- New-Item "$pkg_src_bin" -ItemType Directory
+ New-Item "$pkg_src_bin" -ItemType Directory -Force
Move-Item -Path ".\keypairs.exe" -Destination "$pkg_src_bin"
# Exit tmp
# Enter tmp
pushd .local\tmp
- # Remove any leftover tmp cruft
+ # Remove any leftover tmp cruft
Remove-Item -Path ".\watchexec-v*" -Recurse -ErrorAction Ignore
Remove-Item -Path ".\watchexec.exe" -Recurse -ErrorAction Ignore
echo "Unpacking $pkg_download"
& tar xf "$pkg_download"
-
+
# Settle unpacked archive into place
echo "Install Location: $pkg_src_cmd"
- New-Item "$pkg_src_bin" -ItemType Directory
+ New-Item "$pkg_src_bin" -ItemType Directory -Force
Move-Item -Path ".\watchexec-*\watchexec.exe" -Destination "$pkg_src_bin"
# Exit tmp
--- /dev/null
+#!/usr/bin/env pwsh
+
+curl.exe -s "https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi" -o "$Env:USERPROFILE\Downloads\wsl_update_x64.msi"
+msiexec /a "$Env:USERPROFILE\Downloads\wsl_update_x64.msi" /qb TARGETDIR="C:\temp"
+copy C:\temp\System32\lxss\tools\kernel C:\Windows\System32\lxss\tools\
+
+dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
+dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
+
+Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
+
+wsl --set-default-version 2
+
+# TODO
+#Set-VMProcessor -VMName <VMName> -ExposeVirtualizationExtensions $true