-
Notifications
You must be signed in to change notification settings - Fork 605
Pester Tests
Alan Renouf edited this page Nov 10, 2016
·
2 revisions
#How to run Pester Tests
To use Pester to run tests against your environment to ensure the PowerCLI code is working, use the following steps:
- Download or clone this repository to your local machine
- Unzip if necessary
- Launch PowerShell or PowerCLI and CD into the Pester folder
- Run the following code replacing the details for your VC
Invoke-Pester -Script @{ Path = '.\*.ps1'; Parameters = @{ VCNAME="VC01.local"; VCUSER="[email protected]"; VCPASS="Admin!23"} }
The below is an example of how to run a test using PowerCLI Core:
docker run --rm -it \
-v ~/Dropbox/VMware/PowerCLI-Example-Scripts:/tmp/scripts vmware/powerclicore powershell 'Invoke-Pester -Script @{ Path = "/tmp/scripts/Pester/Test Connection to VC.ps1"; Parameters = @{ VCNAME="10.160.78.212"; VCUSER="[email protected]"; VCPASS="Admin!23"} }'