Quickie: ConvertTo-PSCustomObject

Do you ever need to quickly hop between PowerShell tabs in VScode, or have data you want to move from one session to another?

Sure, you could output your data into a .CSV file, a .JSon file, or one of hundreds of other options.  But sometimes it’s nice to just paste right into a new window and get up and running again.  For that, I wrote this small little cmdlet.

 Function ConvertTo-PSCustomObject{
    $out = "[PSCustomObject]@{`n"
    $Properties = $InputObject | Get-Member | Where MemberType -eq Property
    ForEach ($prop in $Properties){
        $name = $prop.Name
        if ([String]::IsNullOrEmpty($InputObject.$name)){
            $value = $null
        else {
            $value = $InputObject.$name

        $out += "`t$name = '$value'`n"

    $out += "}"

And the usage of it:



Quickie – Join video files with PowerShell and FFMPEG

Caption Text says 'Join Video Files quickly, gluing stuff with PowerShell and ffMpeg', overlaid on an arts and craft scene of glues, papers, scissors and various harvest herbs

While I’m working on some longer posts, I thought I’d share a quick snippet I came up with this weekend as I was backing up a number of old DVDs of family movies.

FFMPeg has the awesome ability to join a number of video files together for you, but the syntax can be kind of strange.  Once I learned the syntax, I sought to make sure I never had to do it again, and created this cmdlet.

Usage notes

In this basic version, it will join every file in a directory, giving you Output.mkv.  Be sure your files in the directory are sequentially ordered as well, to control their position.

Ensure that FFMpeg’s binaries are available in your Path variable as well.

Later on, I may add the ability to provide which specific files you want to join, if desired 🙂

Enjoy 🙂


SOLVED! Windows 10 Reset – There was a problem resetting your PC


Windows 10 built on the awesome features of Windows 8, and brought over the very powerful ‘Refresh My PC’ and ‘Reset My PC’ options.  Truly awesome, they’re able to refresh the base OS and forklift over your files, giving you that ‘just installed’ smell we all love so much.

I love that smell so much in fact, that I buy a new car every few weeks, or sometimes sleep in cars at the CarMax down the road from my house.  Mmmmm plastic and leather offgas.

However, sometimes things go awry, and from no fault of our own, we can end up with a system which will refuse to either reset or refresh.  Read on to see how to fix this problem.   Continue reading

SCOM: Quickly find Update Rollup Version

It’s SO tedious to track down the update rollup version of SCOM, as the SCOM console still doesn’t have this information available (only major releases!), so you end up looking through the registry or digging into files trying to look at the file version manually.

I wrote this little script in PowerShell. Simply CD into the drive where SCOM is installed and it will track down the SCOM install directory for you, then pull out the Update rollup version and return it to screen.



Back with the release of Office ’97 in November of 1996, Microsoft introduced a beloved new helper tool to assist users in navigating through the daunting changes in Microsoft Office,

Microsoft Clippy!

Copyright : Microsoft
Copyright : Microsoft

Clippy was wildly beloved by end-users and IT Professionals alike, just checkout it’s many accomplishments!

Smithsonian Magazine called Clippy “one of the worst software design blunders in the annals of computing”.[16] Time magazine included Clippy in a 2010 article listing fifty worst inventions.[17]

The creator of Clippy went on to great things, and was definitely never haunted by the memory of Clippy, as you can see in his keynote discussion at ROFLCon.

For too many years, Clippy has gone missing in Windows, and admins were left with horrible solutions, like sending e-mails or talking to their users face-to-face.

But now he’s back!

I am proud to share with you my newest slap-dash project,  ‘Invoke-Clippy!


Clippy, how I've missed you!
Clippy, how I’ve missed you!

Today, it pretty much just pops up the familiar character.  Being a very lazy retreading of Chrissy’s code from her ‘Hey Scripting Guy’ article, it also features the PowerShell logo in the system tray to end the code!  AND it runs hidden!

You have the option of specifying -Button1 or -Button2 to add additional buttons.  If you’d like the buttons to do anything, add some code for them to the empty script blocks on line 71 and line 80.

Consider this a framework to use to annoy–, er notify your coworkers with helpful reminders.


  • Scheduled Task on your coworkers machine every 15 minutes to remind them to check the ticket queue
  • Add two buttons, and make the second button spawn another instance of Clippy (consider reversing the X,Y values to make Clippy appear on the other side)
  • Use this as a nice and professional way to communicate mandatory reboots to your end users

No matter what you come up with, share it with the class!  Did you find a way to make this appear interactively on a remote session?  Did you add -ComputerName support (If you did, AWESOME!).

Either comment here or make your own fork and send me a Pull Request.  I’d love to see what you come up with.


Pretty much everything here I learned on the spot thanks to Stack Overflow.  Also big big thanks to Chrissy Lemaire in her excellent Scripting Guys article, ‘How to Create Popups’ in PowerShell.  Most of the code for window sizing comes from her work!