Created
November 6, 2020 14:30
-
-
Save virtualhobbit/80873ebb95f69532f3f2e04e4a733da3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
install_powercli: | |
stage: install | |
tags: | |
- windows | |
script: | |
- Write-Host "Installing NuGet" | |
- Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force | |
- Write-Host "Set the repo installation policy" | |
- Set-PSRepository PSGallery -InstallationPolicy Trusted | |
- Write-Host "Installing PowerCLI" | |
- Install-Module -Name VMware.PowerCLI -Scope CurrentUser -Confirm:$false | |
- sleep 60 | |
- Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $false -InvalidCertificateAction Ignore -Confirm:$false | |
- Write-Host "Importing the helper module" | |
- Import-Module VMware.VimAutomation.HorizonView | |
- if (Test-Path $env:Temp\PowerCLI-Example-Scripts){Remove-Item $env:Temp\PowerCLI-Example-Scripts -Recurse -Force -Confirm:$false} | |
- git clone $exampleScriptURL $env:Temp\PowerCLI-Example-Scripts | |
- $modulePath = [Environment]::GetEnvironmentVariable('PSModulePath').split(";")[0] | |
- if (Test-Path $modulePath\PowerCLI-Example-Scripts){Remove-Item $modulePath\PowerCLI-Example-Scripts -Recurse -Force -Confirm:$false} | |
- Copy-Item -Recurse $env:Temp\PowerCLI-Example-Scripts $modulePath |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment