AmmarRahman/wsl-vpn

Permission issue with download ps

crazyhouse33 opened this issue · 0 comments

Hello
I got issues with no-docker setup.
Copying from windows to linux is not allowed. This code fix:

# Download even if WSL vpn is not patched yet
function download_ps()
{
  # $1 - Url
  # $2 - Download file (relative to cwd)
  local user="$("${SYSTEM_ROOT}/system32/WindowsPowerShell/v1.0/powershell.exe" -command 'Write-Host -NoNewline "$Env:UserName"')"
  "${SYSTEM_ROOT}/system32/WindowsPowerShell/v1.0/powershell.exe" -NoProfile -Command "Invoke-WebRequest -Uri \"$1\" -OutFile \"\$HOME/Downloads/$2\""
  cp -r  /mnt/c/users/$user/Downloads/$2 $2
}