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

WordPress: Add Search Box Into Header

Navigate to Appearance > Theme Editor > select header.php > search for this section: <div…

How to Import Files Into a Docker Container

1. Use SCP to copy files to the remote server while logged onto the local…

PowerShell: Remove an A-Host Record within Active Directory Integrated DNS Domain

Warning: this code is NOT 'production ready'. Please review and test on DEV environments carefully…