From 50a79de9b860989af78b984f618493b8bcda601e Mon Sep 17 00:00:00 2001 From: PrincessPi3 Date: Mon, 18 May 2026 05:19:41 -0600 Subject: [PATCH] workan on ps script for gettin fuckin usb to fuckin work on wsl --- Windows-Scripts/get_wsl_usb.ps1 | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Windows-Scripts/get_wsl_usb.ps1 diff --git a/Windows-Scripts/get_wsl_usb.ps1 b/Windows-Scripts/get_wsl_usb.ps1 new file mode 100644 index 0000000..b231382 --- /dev/null +++ b/Windows-Scripts/get_wsl_usb.ps1 @@ -0,0 +1,25 @@ +# llm cancer string that amkes it run as admin +if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { + Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs + exit +} +# Your code goes here +Write-Host "Admin Perms Confirmed!" +Write-Host "Launching WSL" +# lanch in enew window so we can run usbipd commands in the current one +Start-Process pwsh.exe "-NoExit","-Command", "wsl", "-d", "kali-wsl" +# Write-Host "Press Any Key To Continue" +# Clear-Host +Write-Host "Listing usb devices, remember the busid (ex. 1-3) of the device you wish to attach to WSL" +usbipd list +# Write-Host "Press Any Key To Continue" +# $null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") +$BUSID = Read-Host "Enter The BUSID of the USB Device You Wish to Attach to WSL" +Clear-Host +Write-Host "Attaching USB Device with BUSID $BUSID" +usbipd bind --force --busid $BUSID +usbipd attach --wsl --busid $BUSID +Write-Host "USB Device With BUSID $BUSID Has Been Attached to WSL" +Write-Host "Press Any Key To Exit" +$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown") +exit \ No newline at end of file