Add Multi-Line Content to a Linux File with Add-Content

You have a large number of files to edit that are used by Linux servers. The editing and distributing of these files has to be done on a Windows platform. You want to append some multi-line detail to these files with PowerShell, but the file still needs to be compatible with Linux. Now, Add-Content with a here string would seem to…


Update MP's for SCOM with VMM2012 R2

The fun starts here.   VMM is like more 3rd party management packs that require an app update, then push updates to SCOM.   The initial VMM MS configuration will upload the VMM UR packs to SCOM, but what do you do the next time you update VMM how do you upgrade SCOM to the latest…


Script To Check Exchange NTFS Cluster Size

An issue came to light when onsite recently with a customer.  The design specifications from the Exchange team were not being correctly implemented.  In this environment there is a separate Windows team who are responsible for managing the underlying server OS and hardware.  They are to follow the prescribed process and steps laid down by…


PS without BS: Let's play "Where's that MSI?"

That infamous folder c:windowsinstaller can take up a lot of space and resources, more importantly, it’s cryptic when you see a bunch of numbered MSI and MSP files. What is this good for? Well, my favorite reason is that on occasion you can find the MSI of a software package that may require a manual…


Viewing Memory in PowerShell

Hello there, this is Benjamin Morgan, and I’m a Premier Field Engineer covering Active Directory and Platforms related topics.  This is my first blog post I hope you are all as excited about this as I am! Today I wanted to talk with you about a couple of quick ways for querying system memory (and provide…

2

Export all alerts created in a OMS Workspace to csv

Hi all, Today I bring you a little script for exporting all the alerts you have created in a OMS workspace, this is useful for alert management and for having documentation about it’s configuration. It creates a CSV like this: When you run it, it will list all the alerts it is getting. Be patient…

1

One-Liner: PowerShell Pi Mnemonic

I love this. I came across it when looking into how to calculate Pi with PowerShell.   “$(‘How I wish I could calculate Pi better’.split(‘ ‘) | % {$_.length})”     I’ve tweaked it ever so slightly.   $(‘How I wish I could calculate Pi better’ -Split ” ” | % {[string]$a += $_.length}; $a.Insert(1,”.”))…


Slow Code: Top 5 Ways to Make Your PowerShell Scripts Run Faster

Slow code? Are you frustrated by slow PowerShell scripts? Is it impacting business processes? Need help tuning your scripts? Today’s post is for you. Can you identify with any of these customer slow PowerShell stories? Case #1 Customer is scanning Active Directory Domain Controllers in multiple domains and forests scattered all over the state on…

4

Profile Power: Adjust Console Opacity

WMF 5.1 comes with some cool improvements to the console. One of which I enable via my $profile, the script that runs when I start the PowerShell.exe host.     The WindowsAlpha registry value determine the opacity of the console, as does the Opacity slider below.     What’s in my $profile then?   Set-ItemProperty -Path…