mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
parent
5ba5261c8b
commit
b2ee1d9315
1 changed files with 3 additions and 2 deletions
|
|
@ -2,7 +2,8 @@ function Get-IcingaWindowsInformation()
|
|||
{
|
||||
param (
|
||||
[string]$ClassName,
|
||||
$Filter
|
||||
$Filter,
|
||||
[switch]$ForceWMI = $FALSE
|
||||
);
|
||||
|
||||
$Arguments = @{
|
||||
|
|
@ -15,7 +16,7 @@ function Get-IcingaWindowsInformation()
|
|||
);
|
||||
}
|
||||
|
||||
if ((Get-Command 'Get-CimInstance' -ErrorAction SilentlyContinue)) {
|
||||
if ($ForceWMI -eq $FALSE -And (Get-Command 'Get-CimInstance' -ErrorAction SilentlyContinue)) {
|
||||
try {
|
||||
return (Get-CimInstance @Arguments -ErrorAction Stop)
|
||||
} catch {
|
||||
|
|
|
|||
Loading…
Reference in a new issue