Enable and disable MSI logging through PowerShell

This morning I was contacted by an IT Pro asking me if I could write some PowerShell code to enable and disable MSI logging.
He both wanted to use it from a command line and needed it to be part of a big troubleshooting script he’s working on; so reusable code.

First up is a function to enable the MSI logging:

Next is a function to disable the MSI logging:

As you can see I’m simply using the registry to enable/disable it.
I’m currently writing some other functions that I’ll post in the near future.

Update: Shay Levy contacted me stating that I’m using Test-ItemProperty and that doesn’t exist. He’s correct since it’s part of my personal toolkit. So I’ve decided to share it with you here.

Leave a Reply

Your email address will not be published. Required fields are marked *