[DSC]Replace deprecated Get-WmiObject with Get-CimInstance (#32191)

This commit is contained in:
gokcekantarci 2024-04-02 23:17:39 +03:00 committed by GitHub
parent 794a5db1b0
commit b31eaf3a0b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -249,7 +249,7 @@ class {{module.Name}} {
if ($this.Debug -eq $true) { if ($this.Debug -eq $true) {
$SettingsExePath = "{{debugSettingsPath}}" $SettingsExePath = "{{debugSettingsPath}}"
} else { } else {
$installation = Get-WmiObject Win32_Product | Where-Object {$_.Name -eq "PowerToys (Preview)" -and $_.Version -eq "{{version}}"} $installation = Get-CimInstance Win32_Product | Where-Object {$_.Name -eq "PowerToys (Preview)" -and $_.Version -eq "{{version}}"}
if ($installation) { if ($installation) {
$SettingsExePath = Join-Path (Join-Path $installation.InstallLocation WinUI3Apps) PowerToys.Settings.exe $SettingsExePath = Join-Path (Join-Path $installation.InstallLocation WinUI3Apps) PowerToys.Settings.exe