PowerCLI examples and reference guide for VMware Cloud Foundation (VCF) 9.0 components and related infrastructure management.
- Enhanced Security - Certificate lifecycle management, identity federation
- Simplified Operations - Automated lifecycle management, health monitoring
- Multi-Cloud Ready - Hybrid cloud connectivity, workload mobility
- Advanced Networking - NSX 4.2.0 integration, micro-segmentation
- Storage Optimization - vSAN 8.0 U3 performance enhancements
- VCF Management - SDDC Manager connection and basic operations
- Health Monitoring - Health check examples and reporting scripts
- Infrastructure Operations - Host, cluster, and network management examples
- Component Connections - Connection examples for all VCF components
- Best Practices - Security and Success handling demonstrations
- System Requirements
- Quick Start
- Installation
- Configuration
- Usage Examples
- Component Guides
- Security
- Contributing
- License
# 1. Install VCF PowerCLI
Install-Module -Name VCF.PowerCLI -Scope CurrentUser
# 2. Clone repository
git clone https://github.com/uldyssian-sh/vmware-vcf-powercli.git
cd vmware-vcf-powercli
# 3. Connect to SDDC Manager
$credential = Get-Credential
.\examples\Connect-VCF.ps1 -Server "vcf-mgmt01.domain.local" -Credential $credential
# 4. Get inventory
.\examples\Get-VCFInventory.ps1| Component | Requirement |
|---|---|
| Operating System | Windows 10/11, Windows Server 2019/2022, RHEL 8/9, Ubuntu 20.04/22.04, macOS 12+ |
| PowerShell | 7.2.0 or later (PowerShell Core) |
| VCF PowerCLI | 13.3.0 or later |
| VCF.PowerCLI | 9.0.0.24798382 or later |
| VCF Version | 9.0.0 (Build 24798382) |
| vSphere | 8.0 Update 3 (Build 24022515) |
| NSX | 4.2.0 (Build 23761687) |
| vSAN | 8.0 Update 3 (Build 24022515) |
| Network | HTTPS (443) to SDDC Manager, DNS resolution |
# 1. Verify PowerShell version (7.2+ required)
$PSVersionTable.PSVersion
# 2. Set execution policy
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# 3. Install NuGet provider
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
# 4. Trust PowerShell Gallery
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
# 5. Install .NET 6.0+ (if not present)
# Download from: https://dotnet.microsoft.com/download/dotnet/6.0# Install VMware PowerCLI (base requirement)
Install-Module -Name VMware.PowerCLI -MinimumVersion 13.3.0 -Scope CurrentUser -Force
# Install VCF PowerCLI (VCF-specific cmdlets)
Install-Module -Name VCF.PowerCLI -RequiredVersion 9.0.0.24798382 -Scope CurrentUser -Force
# Verify installation
Get-Module -Name VMware.PowerCLI, VCF.PowerCLI -ListAvailable | Select-Object Name, Version
# Import modules
Import-Module VMware.PowerCLI, VCF.PowerCLI# Download modules
Save-Module -Name VCF.PowerCLI -Path "C:\Temp\VCF-PowerCLI" -Repository PSGallery
# Install from local path
Install-Module -Name VCF.PowerCLI -Repository PSGallery -Force# Configure PowerCLI settings
Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false -Scope Session
Set-PowerCLIConfiguration -ParticipateInCEIP $false -Confirm:$false -Scope Session
Set-PowerCLIConfiguration -DefaultVIServerMode Multiple -Confirm:$false -Scope Session# Method 1: Windows Credential Manager (Recommended)
$credential = Get-Credential -Message "Enter VCF SDDC Manager credentials"
$credential | Export-Clixml -Path "$env:USERPROFILE\Documents\vcf-credentials.xml"
# Method 2: Environment Variables (Development only)
$env:VCF_SERVER = "vcf-mgmt01.domain.local"
$env:VCF_USERNAME = "[email protected]"Create config.json (excluded from git):
{
"sddcManager": "vcf-mgmt01.domain.local",
"domain": "domain.local",
"logLevel": "Info",
"timeout": 300
}# Load stored credentials
$credential = Import-Clixml -Path "$env:USERPROFILE\Documents\vcf-credentials.xml"
# Connect to SDDC Manager
.\examples\Connect-VCF.ps1 -Server "vcf-mgmt01.domain.local" -Credential $credential# Get comprehensive inventory
.\examples\Get-VCFInventory.ps1 -OutputPath "C:\Reports\vcf-inventory.csv"
# Perform health checks
.\examples\Get-VCFHealthStatus.ps1
# Get system information
.\examples\Get-VCFSystemInfo.ps1More Examples: See the examples directory for comprehensive usage scenarios.
PowerCLI examples and connection guides organized by VMware components:
- vSphere & vSAN - Virtual infrastructure management and hyper-converged storage
- NSX-T Data Center - Network virtualization and security
- VCF SDDC Manager - Cloud Foundation lifecycle management
- vCloud Director - Multi-tenant cloud infrastructure
- VMware Cloud Services - Cloud services platform management
- VMware Cloud on AWS - Hybrid cloud on Amazon Web Services
- vRealize Operations Manager - Performance monitoring and analytics
- Site Recovery Manager - Disaster recovery automation
- VMware HCX - Hybrid cloud extension and migration
- Secure Credential Storage - Windows Credential Manager integration
- Input Validation - Comprehensive parameter validation
- Success Handling - Robust exception management
- Audit Logging - Detailed operation logging
- No Hardcoded Secrets - Zero embedded credentials
| Tool | Status | Purpose |
|---|---|---|
| PSScriptAnalyzer | Active | PowerShell best practices |
| GitHub CodeQL | Active | Security vulnerability detection |
| Dependabot | Active | Dependency security updates |
- Never commit credentials or API keys
- Use secure credential storage methods
- Validate all input parameters
- Implement proper Success handling
- Enable audit logging for compliance
We welcome contributions! Please see our Contributing Guidelines for details.
This project is licensed under the MIT License - see the LICENSE file for details.
VMware Cloud Foundation PowerCLI Guide
Data Source Reference: https://developer.broadcom.com/powercli