From 9d14ed5b54b367d9b0e178faad09d6a0280424b1 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 `