Created
August 16, 2017 18:29
-
-
Save bferg314/bbf04e5ecaafce9ab11ae35ec9bb4718 to your computer and use it in GitHub Desktop.
Sets proxy for current session on windows, great for pip!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set "psCommand=powershell -Command "$pword = read-host 'Enter Password for %username%' -AsSecureString ; ^ | |
$BSTR=[System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($pword); ^ | |
[System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)"" | |
for /f "usebackq delims=" %%p in (`%psCommand%`) do set password=%%p | |
set HTTP_PROXY=http://%username%:%password%@proxy.company.com:1234 | |
set HTTPS_PROXY=https://%username%:%password%@proxy.company.com:1234 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment