Look at PowerShell Scriptomatic

PowerShell Scriptomatic allows us to generate WMI scripts using PowerShell script without writing it manually. This tool will generate the script automatically based on selected WMI class and method. We can even run the generated script for testing sake. This tool is having built-in WMI browser also.
Next Recommended Reading Look at Microsoft ESP SDK