Something went wrong. Try again.
Monorepo for Aesthetic.Computer aesthetic.computer
Something went wrong. Try again.
1.4 kB · 43 lines
1234567891011121314151617181920212223242526272829303132333435363738394041424344#!/usr/bin/env fish# Enable Windows interop for calling PowerShell from WSL2
echo "🪟 Setting up Windows interop..."
# Check if running in WSL2if not test -d /run/WSL echo "⚠️ Not running in WSL2, skipping Windows interop setup" exit 0end
# Enable binfmt_misc if not already enabledif not test -f /proc/sys/fs/binfmt_misc/WSLInterop echo " Enabling WSL interop in binfmt_misc..." sudo sh -c 'echo :WSLInterop:M::MZ::/init:PF > /proc/sys/fs/binfmt_misc/register 2>/dev/null' || trueend
# Create symlinks for Windows executables if they existset windows_bins powershell.exe cmd.exe wsl.exe wslpath
for bin in $windows_bins if test -f /mnt/c/Windows/System32/$bin and not test -f /usr/local/bin/$bin echo " Linking $bin..." sudo ln -sf /mnt/c/Windows/System32/$bin /usr/local/bin/$bin endend
# Create symlink for PowerShell 7+ if availableif test -f "/mnt/c/Program Files/PowerShell/7/pwsh.exe" and not test -f /usr/local/bin/pwsh.exe echo " Linking pwsh.exe (PowerShell 7+)..." sudo ln -sf "/mnt/c/Program Files/PowerShell/7/pwsh.exe" /usr/local/bin/pwsh.exeend
# Test if it worksif type -q powershell.exe echo "✅ Windows interop enabled!" echo " You can now run: powershell.exe, cmd.exe, etc."else echo "⚠️ Windows interop setup complete but PowerShell not found" echo " Make sure /mnt/c is properly mounted"end