# ------------------------------------------------------------------------------------------
# Function to convert Management Pack version and formatted for 3 digits.
# ------------------------------------------------------------------------------------------
function VerToString
{
param($version)
$myver = "Not Installed"
if($version -eq "0")
{
return $myver
}
if(([string]$version).Length -ge 3)
{
return ([string]$version).Substring(0,3) + ".0"
}
}
# --------------------------------------------------------------------------------------------------------------------
# Function to instantiate Management Feature instances if they are detected, else create Scalable Feature instances
# Dell.FeatureManagement.MonitoringFeature - base class of any feature, one instane will always be created
# Specialized MonFeature instance will be created based on presence (install) of the corresponding feature
# This is useful for displaying only applicable tasks on a feature (installed feature)
# ---------------------------------------------------------------------------------------------------------------------
function CreateMP
{
param($Discovery, $name, $desc, $avail, $version, $config, $license)
# ----------------------------------------------------------------------
# Function to invoke primary discoover wrt SCOM objects and environment
# ----------------------------------------------------------------------
function CallPrimaryDiscoveryScript
{
param ($Discovery, $SCOMEnv)
$visitor = @{}
# Initialize an array of MPNames as null for each
foreach ($mp in $DeviceMonitoringMPs.Keys)
{
$visitor += @{ $mp = $null }
}
# Initialize an array of FeatureVisitor, Map and Version as default value for each (displayed if not otherwise set)
$featurevisitor = @{}
$featuremap = @{}
$featurever = @{}
# gets all SCOM management packs which fit criteria of listing in $DeviceMonitoringMPs ARRAY and if present in that list, VisitorMap[MP] is set to value
$SCOMEnv.GetManagementPacks() | where-object { $DeviceMonitoringMPs.Contains($_.Name) } | foreach -process {
$visitor[$_.Name] = $_
}