...Because someone's gotta tell the story...


To return to the main Blog List, click Full Blog Listing.


Site Updates

CMTrace without CMTrace

Saturday, March 25, 2017 in Powershell (Views: 1234)
PowerShell to the rescue, yet again. Just a quick blog to show a nice, quick and dirty trick to emulate Trace when you are in an environment that may whitelist software from running on clients.

So, say I want to look at the locationservices.log file and don't have Trace - well, PowerShell and the old school get-content cmdlet to the rescue. So, if I want to view that file in realtime like trace, I can use the tail parameter as such:

Get-Content -Path c:\windows\ccm\logs\locationservices.log -Tail 1 –Wait

This will show the log crudely, like notepad but at least you can monitor the file. Sorry about the lack of reds and yellows. I suppose if you screw up the cmdlet application, you'll get red errors why it won't run. :)

Sample output: you can see, not the best, but not bad for a single line of PowerShell either. Happy scripting.


Related Blogs You May Be Interested In:

To leave a comment, please log in and/or register.