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

Kubernetes Container Deployment with NFS Persistent Volumes

Introduction: Update: we have provided a practical application of the knowledge conveyed in this article…

List Folder Sizes

# Powershell Script to list folders sizes Install-Module PSFolderSize $folders = "\\FILESERVER01\SHARE01","C:\Windows\Users\kimconnect" foreach ($folder in…

PowerShell: Check VLAN of Windows Machine

Le Kommand: Get-NetAdapter|select Name,VlanID Sample Outputs PS C:\Windows\system32> Get-NetAdapter|select Name,VlanIDName VlanID---- ------Ethernet 1 0 PS…