Taking old scripts and updating them with readable coding standards.
- Install required modules:
Install-Module VMware.PowerCLI, Microsoft.PowerShell.SecretManagement, Microsoft.PowerShell.SecretStore
- Edit
config/vcenters.jsonwith your vCenter servers - Run
.\Initialize-VCenterSecrets.ps1interactively to store encrypted credentials - Schedule
Get-AllHostInventory.ps1and/orGet-AllVMInventory.ps1via Task Scheduler
- Review legacy scripts for bugs and issues
- Create JSON config structure (
config/vcenters.json) - Create credential setup script (
Initialize-VCenterSecrets.ps1) using SecretManagement - Rewrite host inventory script (
Get-AllHostInventory.ps1) - Rewrite VM inventory script (
Get-AllVMInventory.ps1) - Copy script-analyzer and powercli-helper agents to this repo
- Update CLAUDE.md with new architecture
- Set up
.claude/settings.local.jsonwith PowerShell MCP permissions - Validate new scripts - PSScriptAnalyzer clean, zero parse errors
- Fill in host inventory collection logic (51 columns matching original report)
- Add
.gitignorefor Output directories and credential files - Move legacy scripts to
legacy/folder - Fill in VM inventory collection logic (68 columns matching original report)
- Test
Initialize-VCenterSecrets.ps1against a real vault - Test host inventory script against a live vCenter
- Test VM inventory script against a live vCenter
EBS_Number,DLA_Asset,Site_Locationcolumns in the host report are output as empty strings - these appear to be custom fields that need to be mapped to your environment's custom attributes or tags- The VM report property list came from an xlsx file (
VMpropertylist.csv) - 68 columns including tags, disk sizes, and vNICs
config/vcenters.json # vCenter list and secret names
Initialize-VCenterSecrets.ps1 # One-time credential setup (interactive)
Get-AllHostInventory.ps1 # ESX host inventory (revamped, 51 columns)
Get-AllVMInventory.ps1 # VM inventory (revamped, 68 columns)
.gitignore # Excludes Output/, *.xlsx, *.cred.xml
legacy/ # Original scripts kept for reference
Get_All_Host_Inventory.ps1
Get_All_VM_Inventory.ps1
.claude/agents/ # Claude Code custom agents
script-analyzer.md # Code review and analysis agent
powercli-helper.md # PowerCLI command generation agent