Skip to content

Commit

Permalink
More updates to remove aliases - better support for PowerCLI core
Browse files Browse the repository at this point in the history
  • Loading branch information
Sneddo authored and Sneddo committed Feb 24, 2017
1 parent bac4040 commit 3892b33
Show file tree
Hide file tree
Showing 90 changed files with 186 additions and 186 deletions.
8 changes: 4 additions & 4 deletions Plugins/00 Initialize/00 Connection Plugin for vCenter.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ switch ($platform.OSFamily) {
}
}

$OpenConnection = $global:DefaultVIServers | where { $_.Name -eq $VIServer }
$OpenConnection = $global:DefaultVIServers | Where-Object { $_.Name -eq $VIServer }
if($OpenConnection.IsConnected) {
Write-CustomOut ( "{0}: {1}" -f $pLang.connReuse, $Server )
$VIConnection = $OpenConnection
Expand Down Expand Up @@ -207,7 +207,7 @@ $Clusters = Get-Cluster | Sort-Object Name
Write-CustomOut $pLang.collectDatastore
$Datastores = Get-Datastore | Sort-Object Name
Write-CustomOut $pLang.collectDVM
$FullVM = Get-View -ViewType VirtualMachine | Where {-not $_.Config.Template}
$FullVM = Get-View -ViewType VirtualMachine | Where-Object {-not $_.Config.Template}
Write-CustomOut $pLang.collectTemplate
$VMTmpl = Get-Template
Write-CustomOut $pLang.collectDVIO
Expand All @@ -221,7 +221,7 @@ $clusviews = Get-View -ViewType ClusterComputeResource
Write-CustomOut $pLang.collectDDatastore
$storageviews = Get-View -ViewType Datastore
Write-CustomOut $pLang.collectAlarms
$valarms = $alarmMgr.GetAlarm($null) | select value, @{N="name";E={(Get-View -Id $_).Info.Name}}
$valarms = $alarmMgr.GetAlarm($null) | Select-Object value, @{N="name";E={(Get-View -Id $_).Info.Name}}

# Find out which version of the API we are connecting to
$VIVersion = ((Get-View ServiceInstance).Content.About.Version).Chars(0)
Expand Down Expand Up @@ -324,7 +324,7 @@ function Get-VIEventPlus {
$si = Get-View ServiceInstance
$schTskMgr = Get-View $si.Content.ScheduledTaskManager
$eventFilter.ScheduledTask = Get-View $schTskMgr.ScheduledTask |
where {$_.Info.Name -match $ScheduledTask} |
Where-Object {$_.Info.Name -match $ScheduledTask} |
Select-Object -First 1 |
Select-Object -ExpandProperty MoRef
}
Expand Down
8 changes: 4 additions & 4 deletions Plugins/00 Initialize/01 General Information.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ $Info = New-Object -TypeName PSObject -Property @{
"Number of Templates" = (@($VMTmpl).Count)
"Number of Clusters" = (@($Clusters).Count)
"Number of Datastores" = (@($Datastores).Count)
"Active VMs" = (@($FullVM | Where { $_.Runtime.PowerState -eq "poweredOn" }).Count)
"In-active VMs" = (@($FullVM | Where { $_.Runtime.PowerState -eq "poweredOff" }).Count)
"Active VMs" = (@($FullVM | Where-Object { $_.Runtime.PowerState -eq "poweredOn" }).Count)
"In-active VMs" = (@($FullVM | Where-Object { $_.Runtime.PowerState -eq "poweredOff" }).Count)
}

# Don't display DRS line if 0 days are set
if ($DRSMigrateAge -gt 0) {
$Info | Add-Member Noteproperty "DRS Migrations for last $($DRSMigrateAge) Days" (@($MigrationQuery1 | Where {$_.GetType().Name -eq "DrsVmMigratedEvent"}).Count)
$Info | Add-Member Noteproperty "DRS Migrations for last $($DRSMigrateAge) Days" (@($MigrationQuery1 | Where-Object {$_.GetType().Name -eq "DrsVmMigratedEvent"}).Count)
}

# Adding vSphere 5 informations
if ($VIVersion -ge 5) {
$Info | Add-Member Noteproperty "Number of Datastore Clusters" $(@($DatastoreClustersView).Count)
if (($MigrationQuery2) -and ($SDRSMigrateAge -gt 0)) {
$Info | Add-Member Noteproperty "Storage DRS Migrations for last $($SDRSMigrateAge) Days" (@($MigrationQuery2 | Where {$_.FullFormattedMessage -imatch "(Storage vMotion){1}.*(DRS){1}"}).Count)
$Info | Add-Member Noteproperty "Storage DRS Migrations for last $($SDRSMigrateAge) Days" (@($MigrationQuery2 | Where-Object {$_.FullFormattedMessage -imatch "(Storage vMotion){1}.*(DRS){1}"}).Count)
}
}

Expand Down
2 changes: 1 addition & 1 deletion Plugins/10 vCenter/23 VI Events.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ $PluginCategory = "vSphere"
$VCEventAge = 1
# End of Settings

Get-VIEventPlus -Start ($Date).AddDays(-$VCEventAge ) -EventType Error | Select @{N="Host";E={$_.host.name}}, createdTime, @{N="User";E={($_.userName.split("\"))[1]}}, fullFormattedMessage
Get-VIEventPlus -Start ($Date).AddDays(-$VCEventAge ) -EventType Error | Select-Object @{N="Host";E={$_.host.name}}, createdTime, @{N="User";E={($_.userName.split("\"))[1]}}, fullFormattedMessage

$Header = ("Error Events (Last {0} Day(s)): [count]" -f $VCEventAge)
10 changes: 5 additions & 5 deletions Plugins/10 vCenter/41 vCenter Services.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ If (! $VCSA) {
If (Test-Path $Credfile) {
$LoadedCredentials = Import-Clixml $Credfile
$creds = New-Object System.Management.Automation.PsCredential($LoadedCredentials.Username,($LoadedCredentials.Password | ConvertTo-SecureString))
$Services = get-wmiobject -Credential $creds win32_service -ComputerName $VIServer -ErrorAction SilentlyContinue| Where {$_.DisplayName -like "VMware*" }
$Services = get-wmiobject -Credential $creds win32_service -ComputerName $VIServer -ErrorAction SilentlyContinue| Where-Object {$_.DisplayName -like "VMware*" }
} Else {
$Services = get-wmiobject win32_service -ComputerName $VIServer -ErrorAction SilentlyContinue | Where {$_.DisplayName -like "VMware*" }
$Services = get-wmiobject win32_service -ComputerName $VIServer -ErrorAction SilentlyContinue | Where-Object {$_.DisplayName -like "VMware*" }
if ($Error[0].Exception.Message -match "Access is denied.") {
# Access Denied Error found so asking to store windows credentials in a file for future use
Write-Host "Current windows credentials do not allow for access to WMI on the host $VIServer, please enter Administrator credentials for this check to work, these will be stored in an encrypted file: $credfile"
$Credential = Get-Credential
$Pass = $credential.Password | ConvertFrom-SecureString
$Username = $Credential.UserName
$Store = "" | Select Username, Password
$Store = "" | Select-Object Username, Password
$Store.Username = $Username
$Store.Password = $Pass
$Store | Export-Clixml $credfile
$Services = get-wmiobject win32_service -ComputerName $VIserver -ErrorAction SilentlyContinue | Where {$_.DisplayName -like "VMware*" }
$Services = get-wmiobject win32_service -ComputerName $VIserver -ErrorAction SilentlyContinue | Where-Object {$_.DisplayName -like "VMware*" }
}
}

Expand Down Expand Up @@ -68,7 +68,7 @@ If (! $VCSA) {
$myCol += $MyDetails
}

$Results = $MyCol | Where {$_.Name -ne $null -and $_.Health -ne "OK"}
$Results = $MyCol | Where-Object {$_.Name -ne $null -and $_.Health -ne "OK"}
$Results
}

Expand Down
8 changes: 4 additions & 4 deletions Plugins/10 vCenter/42 Windows vCenter Error Event Logs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ if (! $VCSA){
If (Test-Path $Credfile) {
$LoadedCredentials = Import-Clixml $Credfile
$creds = New-Object System.Management.Automation.PsCredential($LoadedCredentials.Username,($LoadedCredentials.Password | ConvertTo-SecureString))
$WMI = @(Get-WmiObject -cred $creds -computer $VIServer -query ("Select * from Win32_NTLogEvent Where Type='Error' and TimeWritten >='" + $ConvDate + "'") -ErrorAction SilentlyContinue | Where {$_.Message -like "*VMware*"} | Select @{N="TimeGenerated";E={$_.ConvertToDateTime($_.TimeGenerated)}}, Message)
$WMI = @(Get-WmiObject -cred $creds -computer $VIServer -query ("Select * from Win32_NTLogEvent Where Type='Error' and TimeWritten >='" + $ConvDate + "'") -ErrorAction SilentlyContinue | Where-Object {$_.Message -like "*VMware*"} | Select-Object @{N="TimeGenerated";E={$_.ConvertToDateTime($_.TimeGenerated)}}, Message)
} Else {
$WMI = @(Get-WmiObject -computer $VIServer -query ("Select * from Win32_NTLogEvent Where Type='Error' and TimeWritten >='" + $ConvDate + "'") -ErrorAction SilentlyContinue | Where {$_.Message -like "*VMware*"} | Select @{N="TimeGenerated";E={$_.ConvertToDateTime($_.TimeGenerated)}}, Message)
$WMI = @(Get-WmiObject -computer $VIServer -query ("Select * from Win32_NTLogEvent Where Type='Error' and TimeWritten >='" + $ConvDate + "'") -ErrorAction SilentlyContinue | Where-Object {$_.Message -like "*VMware*"} | Select-Object @{N="TimeGenerated";E={$_.ConvertToDateTime($_.TimeGenerated)}}, Message)
if ($Error[0].Exception.Message -match "Access is denied.") {
# Access Denied Error found so asking to store windows credentials in a file for future use
Write-Host "Current windows credentials do not allow for access to WMI on the host $VIServer, please enter Administrator credentials for this check to work, these will be stored in an encrypted file: $credfile"
$Credential = Get-Credential
$Pass = $credential.Password | ConvertFrom-SecureString
$Username = $Credential.UserName
$Store = "" | Select Username, Password
$Store = "" | Select-Object Username, Password
$Store.Username = $Username
$Store.Password = $Pass
$Store | Export-Clixml $credfile
$WMI = @(Get-WmiObject -cred $Credential -computer $VIServer -query ("Select * from Win32_NTLogEvent Where Type='Error' and TimeWritten >='" + $ConvDate + "'") -ErrorAction SilentlyContinue | Where {$_.Message -like "*VMware*"} | Select @{N="TimeGenerated";E={$_.ConvertToDateTime($_.TimeGenerated)}}, Message)
$WMI = @(Get-WmiObject -cred $Credential -computer $VIServer -query ("Select * from Win32_NTLogEvent Where Type='Error' and TimeWritten >='" + $ConvDate + "'") -ErrorAction SilentlyContinue | Where-Object {$_.Message -like "*VMware*"} | Select-Object @{N="TimeGenerated";E={$_.ConvertToDateTime($_.TimeGenerated)}}, Message)
}
}

Expand Down
8 changes: 4 additions & 4 deletions Plugins/10 vCenter/42 Windows vCenter Event Logs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,20 @@ if (! $VCSA){
If (Test-Path $Credfile) {
$LoadedCredentials = Import-Clixml $Credfile
$creds = New-Object System.Management.Automation.PsCredential($LoadedCredentials.Username,($LoadedCredentials.Password | ConvertTo-SecureString))
$WMI = @(Get-WmiObject -cred $creds -computer $VIServer -query ("Select * from Win32_NTLogEvent Where Type='Error' and TimeWritten >='" + $ConvDate + "'") -ErrorAction SilentlyContinue | Where {$_.Message -like "*VMware*"} | Select @{N="TimeGenerated";E={$_.ConvertToDateTime($_.TimeGenerated)}}, Message)
$WMI = @(Get-WmiObject -cred $creds -computer $VIServer -query ("Select * from Win32_NTLogEvent Where Type='Error' and TimeWritten >='" + $ConvDate + "'") -ErrorAction SilentlyContinue | Where-Object {$_.Message -like "*VMware*"} | Select-Object @{N="TimeGenerated";E={$_.ConvertToDateTime($_.TimeGenerated)}}, Message)
} Else {
$WMI = @(Get-WmiObject -computer $VIServer -query ("Select * from Win32_NTLogEvent Where Type='Error' and TimeWritten >='" + $ConvDate + "'") -ErrorAction SilentlyContinue | Where {$_.Message -like "*VMware*"} | Select @{N="TimeGenerated";E={$_.ConvertToDateTime($_.TimeGenerated)}}, Message)
$WMI = @(Get-WmiObject -computer $VIServer -query ("Select * from Win32_NTLogEvent Where Type='Error' and TimeWritten >='" + $ConvDate + "'") -ErrorAction SilentlyContinue | Where-Object {$_.Message -like "*VMware*"} | Select-Object @{N="TimeGenerated";E={$_.ConvertToDateTime($_.TimeGenerated)}}, Message)
if ($Error[0].Exception.Message -match "Access is denied.") {
# Access Denied Error found so asking to store windows credentials in a file for future use
Write-Host "Current windows credentials do not allow for access to WMI on the host $VIServer, please enter Administrator credentials for this check to work, these will be stored in an encrypted file: $credfile"
$Credential = Get-Credential
$Pass = $credential.Password | ConvertFrom-SecureString
$Username = $Credential.UserName
$Store = "" | Select Username, Password
$Store = "" | Select-Object Username, Password
$Store.Username = $Username
$Store.Password = $Pass
$Store | Export-Clixml $credfile
$WMI = @(Get-WmiObject -cred $Credential -computer $VIServer -query ("Select * from Win32_NTLogEvent Where Type='Error' and TimeWritten >='" + $ConvDate + "'") -ErrorAction SilentlyContinue | Where {$_.Message -like "*VMware*"} | Select @{N="TimeGenerated";E={$_.ConvertToDateTime($_.TimeGenerated)}}, Message)
$WMI = @(Get-WmiObject -cred $Credential -computer $VIServer -query ("Select * from Win32_NTLogEvent Where Type='Error' and TimeWritten >='" + $ConvDate + "'") -ErrorAction SilentlyContinue | Where-Object {$_.Message -like "*VMware*"} | Select-Object @{N="TimeGenerated";E={$_.ConvertToDateTime($_.TimeGenerated)}}, Message)
}
}

Expand Down
8 changes: 4 additions & 4 deletions Plugins/10 vCenter/43 Windows vCenter Warning Event Logs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ If (! $VCSA) {
If (Test-Path $Credfile) {
$LoadedCredentials = Import-Clixml $Credfile
$creds = New-Object System.Management.Automation.PsCredential($LoadedCredentials.Username,($LoadedCredentials.Password | ConvertTo-SecureString))
$WMI = @(Get-WmiObject -Credential $creds -computer $VIServer -query ("Select * from Win32_NTLogEvent Where Type='Warning' and TimeWritten >='" + $ConvDate + "'") -ErrorAction SilentlyContinue| Where {$_.Message -like "*VMware*"} | Select @{N="TimeGenerated";E={$_.ConvertToDateTime($_.TimeGenerated)}}, Message)
$WMI = @(Get-WmiObject -Credential $creds -computer $VIServer -query ("Select * from Win32_NTLogEvent Where Type='Warning' and TimeWritten >='" + $ConvDate + "'") -ErrorAction SilentlyContinue| Where-Object {$_.Message -like "*VMware*"} | Select-Object @{N="TimeGenerated";E={$_.ConvertToDateTime($_.TimeGenerated)}}, Message)
} Else {
@($WMI = Get-WmiObject -computer $VIServer -query ("Select * from Win32_NTLogEvent Where Type='Warning' and TimeWritten >='" + $ConvDate + "'") -ErrorAction SilentlyContinue | Where {$_.Message -like "*VMware*"} | Select @{N="TimeGenerated";E={$_.ConvertToDateTime($_.TimeGenerated)}}, Message)
@($WMI = Get-WmiObject -computer $VIServer -query ("Select * from Win32_NTLogEvent Where Type='Warning' and TimeWritten >='" + $ConvDate + "'") -ErrorAction SilentlyContinue | Where-Object {$_.Message -like "*VMware*"} | Select-Object @{N="TimeGenerated";E={$_.ConvertToDateTime($_.TimeGenerated)}}, Message)
if ($Error[0].Exception.Message -match "Access is denied.") {
# Access Denied Error found so asking to store windows credentials in a file for future use
Write-Host "Current windows credentials do not allow for access to WMI on the host $VIServer, please enter Administrator credentials for this check to work, these will be stored in an encrypted file: $credfile"
$Credential = Get-Credential
$Pass = $credential.Password | ConvertFrom-SecureString
$Username = $Credential.UserName
$Store = "" | Select Username, Password
$Store = "" | Select-Object Username, Password
$Store.Username = $Username
$Store.Password = $Pass
$Store | Export-Clixml $credfile
$WMI = @(Get-WmiObject -Credential $Credential -computer $VIServer -query ("Select * from Win32_NTLogEvent Where Type='Warning' and TimeWritten >='" + $ConvDate + "'") -ErrorAction SilentlyContinue | Where {$_.Message -like "*VMware*"} | Select @{N="TimeGenerated";E={$_.ConvertToDateTime($_.TimeGenerated)}}, Message)
$WMI = @(Get-WmiObject -Credential $Credential -computer $VIServer -query ("Select * from Win32_NTLogEvent Where Type='Warning' and TimeWritten >='" + $ConvDate + "'") -ErrorAction SilentlyContinue | Where-Object {$_.Message -like "*VMware*"} | Select-Object @{N="TimeGenerated";E={$_.ConvertToDateTime($_.TimeGenerated)}}, Message)
}
}

Expand Down
6 changes: 3 additions & 3 deletions Plugins/10 vCenter/47 vCenter Session Age.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ $vCenterSessionsDoNotInclude = Get-vCheckSetting $Title "vCenterSessionsDoNotInc
# Retrieve vCenter sessions and report any sessions that exceed the maximum session age

(Get-View $ServiceInstance.Content.SessionManager).SessionList | `
Where {$_.LoginTime -lt (Get-Date).AddHours(-$MaxvCenterSessionAge) -AND `
Where-Object {$_.LoginTime -lt (Get-Date).AddHours(-$MaxvCenterSessionAge) -AND `
$_.UserName -notmatch $vCenterSessionsDoNotInclude} | `
select LoginTime, UserName, FullName, @{N="IdleMinutes";e={([Math]::Round(((Get-Date)-($_.lastActiveTime).ToLocalTime()).TotalMinutes))}} | `
Where {$_.IdleMinutes -ge $MinvCenterSessionAge}
Select-Object LoginTime, UserName, FullName, @{N="IdleMinutes";e={([Math]::Round(((Get-Date)-($_.lastActiveTime).ToLocalTime()).TotalMinutes))}} | `
Where-Object {$_.IdleMinutes -ge $MinvCenterSessionAge}

$Comments = "The following displays vCenter sessions that exceed the maximum session age ($MaxvCenterSessionAge Hour(s))."

Expand Down
8 changes: 4 additions & 4 deletions Plugins/10 vCenter/82 License Report.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ $PluginCategory = "vSphere"

$vSphereLicInfo = @()

Foreach ($LicenseMan in Get-View ($ServiceInstance | Select -First 1).Content.LicenseManager)
Foreach ($LicenseMan in Get-View ($ServiceInstance | Select-Object -First 1).Content.LicenseManager)
{
($LicenseMan | Select -ExpandProperty Licenses) | Select @{Name="VC";e={([Uri]$LicenseMan.Client.ServiceUrl).Host}}, `
Name, LicenseKey, Total, Used, @{Name="Information";e={$_.Labels | Select -ExpandProperty Value}}, `
@{"Name"="ExpirationDate";e={$_.Properties | Where { $_.key -eq "expirationDate" } | Select -ExpandProperty Value}}
($LicenseMan | Select-Object -ExpandProperty Licenses) | Select-Object @{Name="VC";e={([Uri]$LicenseMan.Client.ServiceUrl).Host}}, `
Name, LicenseKey, Total, Used, @{Name="Information";e={$_.Labels | Select-Object -ExpandProperty Value}}, `
@{"Name"="ExpirationDate";e={$_.Properties | Where-Object { $_.key -eq "expirationDate" } | Select-Object -ExpandProperty Value}}
}

# Changelog
Expand Down
2 changes: 1 addition & 1 deletion Plugins/20 Cluster/10 HA Configuration Issues.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ $HAIssues += $Clusters | Where-Object {$_.Name -notmatch $ClustersDoNotInclude -
Select-Object @{Name="Cluster";Expression={$_.Name}},@{Name="Configuration Issue";Expression={$pLang.HADisabled}}

# Clusters with host monitoring disabled
$HAIssues += $clusviews | where {$_.Name -notmatch $ClustersDoNotInclude -and ( $_.Configuration.DasConfig.HostMonitoring -eq "enabled" ) -ne $ClusterHAHostMonitoringShouldBeEnabled } |
$HAIssues += $clusviews | Where-Object {$_.Name -notmatch $ClustersDoNotInclude -and ( $_.Configuration.DasConfig.HostMonitoring -eq "enabled" ) -ne $ClusterHAHostMonitoringShouldBeEnabled } |
Select-Object @{Name="Cluster";Expression={$_.Name}}, @{N="Configuration Issue";E={$pLang.HAMonDisabled}}

# Clusters with admission Control Disabled
Expand Down
4 changes: 2 additions & 2 deletions Plugins/20 Cluster/104 Clusters with no Host Profile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ $PluginCategory = "vSphere"
# End of Settings

# Get all host profiles and corresponding cluster ID (don't really care about individual hosts at this stage!)
$HostProfiles = Get-VMHostProfile | Select Name, @{Name="ClusterID";Expression={$_.ExtensionData.Entity | ?{ $_.type -eq "ClusterComputeResource" }}}
$HostProfiles = Get-VMHostProfile | Select-Object Name, @{Name="ClusterID";Expression={$_.ExtensionData.Entity | ?{ $_.type -eq "ClusterComputeResource" }}}

$clusviews | ?{($HostProfiles | Select -expandProperty ClusterID) -notcontains $_.moref } | Sort-Object Name | Select Name
$clusviews | ?{($HostProfiles | Select-Object -expandProperty ClusterID) -notcontains $_.moref } | Sort-Object Name | Select-Object Name
4 changes: 2 additions & 2 deletions Plugins/20 Cluster/17 DRS Migrations.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ if (-not $MigrationQuery1)
}
}

$DRSMigrations = @($MigrationQuery1 | Where {$_.Gettype().Name -eq "DrsVmMigratedEvent"} | Select createdTime, fullFormattedMessage)
$SDRSMigrations = @($MigrationQuery2 | Where {$_.FullFormattedMessage -imatch "(Storage vMotion){1}.*(DRS){1}"} | Select createdTime, fullFormattedMessage)
$DRSMigrations = @($MigrationQuery1 | Where-Object {$_.Gettype().Name -eq "DrsVmMigratedEvent"} | Select-Object createdTime, fullFormattedMessage)
$SDRSMigrations = @($MigrationQuery2 | Where-Object {$_.FullFormattedMessage -imatch "(Storage vMotion){1}.*(DRS){1}"} | Select-Object createdTime, fullFormattedMessage)

$DRSMigrations
$SDRSMigrations
Expand Down
2 changes: 1 addition & 1 deletion Plugins/20 Cluster/38 Cluster Configuration Issues.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ foreach ($clusview in $clusviews) {
}
}

$clualarms | sort name
$clualarms | Sort-Object name
6 changes: 3 additions & 3 deletions Plugins/20 Cluster/52 Datastore Consistency.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ if ($Clusters -ne $null)
{
ForEach ($Cluster in ($Clusters))
{
$Cluster.ExtensionData.Host | %{ $h = $_; $Datastores | Where {$_.ExtensionData.Host.key -contains $h}} |
Where {$_.Name -notmatch $DSDoNotInclude } | Group-Object Name | Where { $_.Count -ne $cluster.ExtensionData.Host.count } |
Select @{Name="Name"; Expression={$_.Group.name}}, @{Name="Cluster";Expression={$Cluster.Name}}
$Cluster.ExtensionData.Host | %{ $h = $_; $Datastores | Where-Object {$_.ExtensionData.Host.key -contains $h}} |
Where-Object {$_.Name -notmatch $DSDoNotInclude } | Group-Object Name | Where-Object { $_.Count -ne $cluster.ExtensionData.Host.count } |
Select-Object @{Name="Name"; Expression={$_.Group.name}}, @{Name="Cluster";Expression={$Cluster.Name}}
}
}
Loading

0 comments on commit 3892b33

Please sign in to comment.