mirror of
https://github.com/shokinn/.files.git
synced 2025-06-28 07:40:40 +00:00
relocate files from .bin to .local/bin; remove dotdrop submodule; Update Installation process; remove pip, pylint and pyenv oh-my-zsh plugins; Update LICENSE;
This commit is contained in:
parent
4c529a3fb0
commit
53ff1bfffa
26 changed files with 68 additions and 145 deletions
44
dotfiles/local/bin/wslenablehypervforwarding
Executable file
44
dotfiles/local/bin/wslenablehypervforwarding
Executable file
|
@ -0,0 +1,44 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
#
|
||||
# This dotfile is managed using dotdrop
|
||||
#
|
||||
|
||||
WINHOME="$(echo "$(cmd.exe /C "echo %USERPROFILE%")" | tr -d '\r')"
|
||||
WINHOMEWSL="$(wslpath ${WINHOME})"
|
||||
|
||||
cat <<EOF > "${WINHOMEWSL}/enablewslhypervforwarding.ps1"
|
||||
#at top of script
|
||||
if (!
|
||||
#current role
|
||||
(New-Object Security.Principal.WindowsPrincipal(
|
||||
[Security.Principal.WindowsIdentity]::GetCurrent()
|
||||
#is admin?
|
||||
)).IsInRole(
|
||||
[Security.Principal.WindowsBuiltInRole]::Administrator
|
||||
)
|
||||
) {
|
||||
#elevate script and exit current non-elevated runtime
|
||||
Start-Process \`
|
||||
-FilePath 'powershell' \`
|
||||
-ArgumentList (
|
||||
#flatten to single array
|
||||
'-ExecutionPolicy', 'Bypass', \`
|
||||
'-File', \$MyInvocation.MyCommand.Source, \$args \`
|
||||
| %{ \$_ }
|
||||
) \`
|
||||
-Verb RunAs
|
||||
exit
|
||||
}
|
||||
|
||||
Set-NetIPInterface -ifAlias "vEthernet (Default Switch)" -Forwarding Enabled
|
||||
Set-NetIPInterface -ifAlias "vEthernet (WSL)" -Forwarding Enabled
|
||||
|
||||
EOF
|
||||
|
||||
powershell.exe -ExecutionPolicy Bypass -File "${WINHOME}\\enablewslhypervforwarding.ps1"
|
||||
sleep 3
|
||||
powershell.exe -ExecutionPolicy Bypass "Get-NetIPInterface | select ifIndex,InterfaceAlias,AddressFamily,ConnectionState,Forwarding | Sort-Object -Property IfIndex | Format-Table"
|
||||
|
||||
|
||||
rm ${WINHOMEWSL}/enablewslhypervforwarding.ps1
|
Loading…
Add table
Add a link
Reference in a new issue