From 7742ff6a1ce70127fd97012602a8809d7e8abb83 Mon Sep 17 00:00:00 2001 From: Bas Roovers Date: Wed, 20 May 2020 08:48:53 +0200 Subject: [PATCH] Replaced Get-WMIObject with Get-CimInstance for PS7 support --- tools/collector-generator/New-Collector.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/collector-generator/New-Collector.ps1 b/tools/collector-generator/New-Collector.ps1 index d926d277b..43944386d 100644 --- a/tools/collector-generator/New-Collector.ps1 +++ b/tools/collector-generator/New-Collector.ps1 @@ -11,10 +11,10 @@ Param( $ErrorActionPreference = "Stop" if($Credential -ne $null) { - $wmiObject = Get-WMIObject -ComputerName $ComputerName -Credential $Credential -Class $Class + $wmiObject = Get-CimInstance -ComputerName $ComputerName -Credential $Credential -Class $Class } else { - $wmiObject = Get-WMIObject -ComputerName $ComputerName -Class $Class + $wmiObject = Get-CimInstance -ComputerName $ComputerName -Class $Class } $members = $wmiObject `