Posted On March 30, 2019

Import A WMWare.PowerCLI from Behind the Proxy

kimconnect 0 comments
blog.KimConnect.com >> Codes >> Import A WMWare.PowerCLI from Behind the Proxy

VMWare PowerCLI is a must for Administrators. Here’s a quick script to install it. If I have time, I’ll add more details on the usefulness of this tool.

$proxy="http://proxy:80"

# Set winhttp proxy
$proxy = [System.Net.WebProxy]::GetDefaultProxy().Address
[system.net.webrequest]::defaultwebproxy = New-Object system.net.webproxy($proxy)
[system.net.webrequest]::defaultwebproxy.credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
[system.net.webrequest]::defaultwebproxy.BypassProxyOnLocal = $true
#$PSDefaultParameterValues = @{ "*:Proxy"="$proxy" }

Import-PackageProvider NuGet -Force
Install-PackageProvider NuGet -Force
Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted
Install-Module -Name VMware.PowerCLI -AllowClobber -Force

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

PowerShell: File Server Cluster Migration Scripts

<# File-Server-Migration-Intra-Domain.ps1 Purposes: 1. Create Volumes with Labels 2. Create Virtual Clustered File Servers 3.…

PowerShell: Deploy Choco Apps

Deployment Instructions: Create a batch file with this content to call this PowerShell Script @echo…