Skip to content

Instantly share code, notes, and snippets.

# Set proxy settings if behind an enterprise proxy by using these in PS profile
[system.net.webrequest]::defaultwebproxy = new-object system.net.webproxy('http://proxy:port')
[system.net.webrequest]::defaultwebproxy.credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
[system.net.webrequest]::defaultwebproxy.BypassProxyOnLocal = $true
# Set proxy settings for git
git config --global https.proxy http://username:password@proxy:port
git config --global http.sslVerify false
# Type the command to install Chocolatey
<#
.Synopsis
Shows Windows native credential dialog on PowerShell 7.x and VS Code.
.DESCRIPTION
The cmdlet utilizes Windows native code based on P/Invoke calls. The parameters and output are the same as Get-Credential cmdlet. Based on the example: https://www.developerfusion.com/code/4693/using-the-credential-management-api/
.SYNTAX
Get-WinCredential [[-UserName] <string>] -Message <string> [<CommonParameters>]
.EXAMPLE
Get-WinCredential
.EXAMPLE
@Zalexanninev15
Zalexanninev15 / choco_install.ps1
Created April 25, 2023 21:06 — forked from apfelchips/choco_install.ps1
chocolatey package install script
# allow running: Set-ExecutionPolicy Bypass -Scope Process -Force
# src: https://gist.github.com/apfelchips/792f7708d0adff7785004e9855794bc0
# goal: install all basic tools / pin software with working autoupdate mechanism / specialized stuff is commented out
# misc: Windows Store .appx downloader https://store.rg-adguard.net/
# Check Permissions
if ( -Not( (New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)) ){
Write-Error -Message "Script needs Administrator permissions"