mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
50 lines
No EOL
2 KiB
PowerShell
50 lines
No EOL
2 KiB
PowerShell
Import-Module $IncludeDir\provider\enums\Icinga_ProviderEnums;
|
|
|
|
|
|
function Get-IcingaWindows()
|
|
{
|
|
$WindowsInformations = Get-CimInstance Win32_OperatingSystem;
|
|
|
|
$OSProductSuite = @();
|
|
$ProviderEnums.WindowsOSProductSuite.Keys | Where-Object {
|
|
$_ -band $WindowsInformations.OSProductSuite
|
|
} | ForEach-Object {
|
|
$OSProductSuite += $ProviderEnums.WindowsOSProductSuite.Get_Item($_);
|
|
};
|
|
|
|
$windows_datails = @{};
|
|
$windows_datails.Add(
|
|
'windows', @{
|
|
'metadata' = @{
|
|
'Version' = $WindowsInformations.Version;
|
|
'CurrentTimeZone' = $WindowsInformations.CurrentTimeZone;
|
|
'InstallDate' = $WindowsInformations.InstallDate;
|
|
'SystemDevice' = $WindowsInformations.SystemDevice;
|
|
'SystemDirectory' = $WindowsInformations.SystemDirectory;
|
|
'BuildType' = $WindowsInformations.BuildType;
|
|
'BuildNumber' = $WindowsInformations.BuildNumber;
|
|
'OSArchitecture' = $WindowsInformations.OSArchitecture;
|
|
'NumberOfUsers' = $WindowsInformations.NumberOfUsers;
|
|
'OSType' = @{
|
|
'raw' = $WindowsInformations.OSType;
|
|
'value' = $ProviderEnums.WindowsOSType[[int]$WindowsInformations.OSType];
|
|
};
|
|
'OSProductSuite' = @{
|
|
'raw' = $WindowsInformations.OSProductSuite;
|
|
'value' = $OSProductSuite;
|
|
};
|
|
'ProductType' = @{
|
|
'raw' = $WindowsInformations.ProductType;
|
|
'value' = $ProviderEnums.WindowsProductType[[int]$WindowsInformations.ProductType];
|
|
};
|
|
};
|
|
'language' = @{
|
|
'CountryCode' = $WindowsInformations.CountryCode;
|
|
'OSLanguage' = $WindowsInformations.OSLanguage;
|
|
'Locale' = $WindowsInformations.Locale;
|
|
}
|
|
}
|
|
);
|
|
|
|
return $windows_datails;
|
|
} |