Skip to content

Commit

Permalink
Slight changes
Browse files Browse the repository at this point in the history
Removing unnecessary array.
  • Loading branch information
Sneddo authored Feb 7, 2017
1 parent 7308699 commit bac4040
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions Plugins/60 VM/49 EVC Mismatch.ps1
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
# Start of Settings
# End of Settings

# Init arrays
$EVCMismatchedVMs = @()

# For Each Host
ForEach ($EVCHost in $VMH) {
## Get cluster EVC mode
Expand All @@ -13,12 +10,9 @@ ForEach ($EVCHost in $VMH) {
$myHostEVCCluster = $EVCHost.Parent.Name

## Get VMs on current host | Filter by Powered On and VM EVC not equal to host EVC | Select VM, Host and Cluster information and concatenate into array
$EVCMismatchedVMs += Get-VM -Location $EVCHost | Where-Object {($_.PowerState -eq "PoweredOn") -and ($_.ExtensionData.Summary.Runtime.MinRequiredEVCModeKey -ne $myHostEVCMode)} | Select-Object Name,@{Name='VM EVC';Expression = {$_.ExtensionData.Summary.Runtime.MinRequiredEVCModeKey}},@{Name='Host';Expression = {$EVCHost.Name}},@{Name='Host EVC';Expression = {$myHostEVCMode}},@{Name='Cluster';Expression = {$myHostEVCCluster}}
Get-VM -Location $EVCHost | Where-Object {($_.PowerState -eq "PoweredOn") -and ($_.ExtensionData.Summary.Runtime.MinRequiredEVCModeKey -ne $myHostEVCMode)} | Select-Object Name,@{Name='VM EVC';Expression = {$_.ExtensionData.Summary.Runtime.MinRequiredEVCModeKey}},@{Name='Host';Expression = {$EVCHost.Name}},@{Name='Host EVC';Expression = {$myHostEVCMode}},@{Name='Cluster';Expression = {$myHostEVCCluster}}
}

# Display completed array
$EVCMismatchedVMs

$PluginCategory = "vSphere"
$Title = "EVC Mismatch"
$Header = "EVC Mismatch"
Expand Down

0 comments on commit bac4040

Please sign in to comment.