$creds = Get-Credential $username = $creds.GetNetworkCredential().UserName $password = $creds.GetNetworkCredential().Password $proxyServer = "https://local/proxy/server" $webProxy = New-Object System.Net.WebProxy($proxyServer,$true) $webclient = new-object System.Net.WebClient $creds = Get-Credential $webclient.Proxy=$webproxy $webclient.Proxy.Credentials = $creds $env:chocolateyProxyLocation = $proxyServer $env:chocolateyProxyUser = $username $env:chocolateyProxyPassword = $password $env:https_proxy = "https://${username}:${password}@${$proxyServer}" # Set directory for installation - Chocolatey does not lock # down the directory if not the default $InstallDir='$env:LOCALAPPDATA\chocoportable' $env:ChocolateyInstall="$InstallDir" # set proxy info in user environment [Environment]::SetEnvironmentVariable("chocolateyProxyLocation", $proxyServer, "User") [Environment]::SetEnvironmentVariable("chocolateyProxyUser", $username, "User") [Environment]::SetEnvironmentVariable("chocolateyProxyPassword", $password, "User") [Environment]::SetEnvironmentVariable("ChocolateyInstall", $InstallDir, "User") [Environment]::SetEnvironmentVariable("PATH", "%ChocolateyInstall%\bin;"+$env:Path, "User") # If your PowerShell Execution policy is restrictive, you may # not be able to get around that. Try setting your session to # Bypass. Set-ExecutionPolicy Bypass # All install options - offline, proxy, etc at # https://chocolatey.org/install iex ($webclient.DownloadString('https://chocolatey.org/install.ps1')) # PowerShell 3+? #iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex choco install git.commandline -y # pick an editor #choco install visualstudiocode.portable -y # not yet available #choco install nano -y #choco install vim-tux.portable # What else can I install without admin rights? # https://chocolatey.org/packages?q=id%3Aportable