From baf366c40db6eedfbe846eecd185be4571c1c51f Mon Sep 17 00:00:00 2001 From: Cosmin <13046837+C0smin@users.noreply.github.com> Date: Thu, 28 Oct 2021 15:01:26 +0200 Subject: [PATCH] Update AvoidUsingWMICmdlet.md Strange character correction --- docs/Rules/AvoidUsingWMICmdlet.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Rules/AvoidUsingWMICmdlet.md b/docs/Rules/AvoidUsingWMICmdlet.md index 3a934b2cc..eeab9802b 100644 --- a/docs/Rules/AvoidUsingWMICmdlet.md +++ b/docs/Rules/AvoidUsingWMICmdlet.md @@ -48,12 +48,12 @@ Change to the equivalent CIM based cmdlet. ```powershell Get-WmiObject -Query 'Select * from Win32_Process where name LIKE "myprocess%"' | Remove-WmiObject -Invoke-WmiMethod ?Class Win32_Process ?Name "Create" ?ArgumentList @{ CommandLine = "notepad.exe" } +Invoke-WmiMethod -Class Win32_Process -Name "Create" -ArgumentList @{ CommandLine = "notepad.exe" } ``` ### Correct ```powershell Get-CimInstance -Query 'Select * from Win32_Process where name LIKE "myprocess%"' | Remove-CIMInstance -Invoke-CimMethod ?ClassName Win32_Process ?MethodName "Create" ?Arguments @{ CommandLine = "notepad.exe" } +Invoke-CimMethod -ClassName Win32_Process -MethodName "Create" -Arguments @{ CommandLine = "notepad.exe" } ```