vSphere-Helper-Interface.ps1
Function VSphere-Report{ param( [parameter(ParameterSetName='DataStores',Mandatory=$true, Position='3')] [Switch]$Datastores, [parameter(ParameterSetName='Snapshots', Mandatory=$true, Position='3')] [Switch]$Snapshots, [parameter(ParameterSetName='Consolidation', Mandatory=$true, Position='3')] [Switch]$Consolidation, [Parameter(ParameterSetName='Monitor', Mandatory=$true, Position='3')] [Alias('Ressource')] [ValidateSet('CPU','HDD')] [String]$Monitor, [Parameter(ParameterSetName='Monitor', Mandatory=$true, Position='4')] [ValidateSet('Day','Week','Month')] [String]$Intervall, [parameter(Mandatory=$true, Position='1')] [IPAddress]$Server, [parameter(Mandatory=$true, Position='2')] [String]$VM, [parameter(Mandatory=$false, Position='5')] [String]$ReportPath ) if($Datastores){ if($ReportPath){ Report-Datastores -Server $Server -VM $VM -ReportPath $ReportPath } if(!($ReportPath)){ Report-DataStores -Server $Server -VM $VM } } if($Snapshots){ if($ReportPath){ Report-Snapshots -Server $Server -VM $VM -ReportPath $ReportPath } if(!($ReportPath)){ Report-Snapshots -Server $Server -VM $VM } } if($Consolidation){ if($ReportPath){ Report-Consolidation -Server $Server -VM $VM -ReportPath $ReportPath } if(!($ReportPath)){ Report-Consolidation -Server $Server -VM $VM } } if($Monitor){ if($ReportPath){ Report-VmStats -Server $Server -VM $VM -Ressource $Monitor -Intervall $Intervall -ReportPath $ReportPath } if(!($ReportPath)){ Report-VmStats -Server $Server -VM $VM -Ressource $Monitor -Intervall $Intervall } } } |