fix execution policy

This commit is contained in:
Philip Henning 2023-07-07 13:58:12 +02:00
parent c97f4c5562
commit 7f47a510c8

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# {{@@ header() @@}} # This dotfile is managed using dotdrop
# #
WINHOME="$(echo "$(cmd.exe /C "echo %USERPROFILE%")" | tr -d '\r')" WINHOME="$(echo "$(cmd.exe /C "echo %USERPROFILE%")" | tr -d '\r')"
@ -23,6 +23,7 @@ if (!
-FilePath 'powershell' \` -FilePath 'powershell' \`
-ArgumentList ( -ArgumentList (
#flatten to single array #flatten to single array
'-ExecutionPolicy', 'Bypass', \`
'-File', \$MyInvocation.MyCommand.Source, \$args \` '-File', \$MyInvocation.MyCommand.Source, \$args \`
| %{ \$_ } | %{ \$_ }
) \` ) \`
@ -35,7 +36,7 @@ Set-NetIPInterface -ifAlias "vEthernet (WSL)" -Forwarding Enabled
EOF EOF
powershell.exe -ExecutionPolicy Bypass -File "${WINHOME}\enablewslhypervforwarding.ps1" powershell.exe -ExecutionPolicy Bypass -File "${WINHOME}\\enablewslhypervforwarding.ps1"
sleep 3 sleep 3
powershell.exe -ExecutionPolicy Bypass "Get-NetIPInterface | select ifIndex,InterfaceAlias,AddressFamily,ConnectionState,Forwarding | Sort-Object -Property IfIndex | Format-Table" powershell.exe -ExecutionPolicy Bypass "Get-NetIPInterface | select ifIndex,InterfaceAlias,AddressFamily,ConnectionState,Forwarding | Sort-Object -Property IfIndex | Format-Table"