Skip to content

Commit 2891c2a

Browse files
authored
Update AvoidUsingWMICmdlet.md (#1737)
1 parent 5ba71a9 commit 2891c2a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/Rules/AvoidUsingWMICmdlet.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ Change to the equivalent CIM based cmdlet.
4848

4949
```powershell
5050
Get-WmiObject -Query 'Select * from Win32_Process where name LIKE "myprocess%"' | Remove-WmiObject
51-
Invoke-WmiMethod ?Class Win32_Process ?Name "Create" ?ArgumentList @{ CommandLine = "notepad.exe" }
51+
Invoke-WmiMethod -Class Win32_Process -Name "Create" -ArgumentList @{ CommandLine = "notepad.exe" }
5252
```
5353

5454
### Correct
5555

5656
```powershell
5757
Get-CimInstance -Query 'Select * from Win32_Process where name LIKE "myprocess%"' | Remove-CIMInstance
58-
Invoke-CimMethod ?ClassName Win32_Process ?MethodName "Create" ?Arguments @{ CommandLine = "notepad.exe" }
58+
Invoke-CimMethod -ClassName Win32_Process -MethodName "Create" -Arguments @{ CommandLine = "notepad.exe" }
5959
```

0 commit comments

Comments
 (0)