Computer Operator

New-LogEntry Snippets

If you liked my previous post, Function to create logs that CMTrace can read and you use the ISE as your editor, I’ve posted a script in my BitBucket link to create three snippets to add that function when you need it. It adds three snippets that are needed.

New-LogEntry - Parameters
New-LogEntry – Parameters

The first one is put in the parameters at the beginning of your script.

New-LogEntry - Function
New-LogEntry – Function

Next, you put in the function.

New-LogEntry - Variables
New-LogEntry – Variables

This is the last piece, it’s the variables and of course the piece to delete the existing file if required.

The script to install these snippets will overwrite the existing snippets with the same name (if you, by some miracle, already have them). You can get it from the BitBucket link, the name is Install-New-LogEntry-Snippets.ps1. I know, I didn’t follow recommended naming convention, but that’s what it’s called. Or copy and paste it from below.