This post builds on some previous post titled Use base64 for Images in WPF-based PowerShell Forms.
Show-WpfIconExample.ps1, which can be found below and on github, demonstrates how to overlay the default PowerShell toolbar icon with an image that's been transformed to a base64 string to …
Read MoreUpdate Jan 7: Added KeyboardInterop so that TextBoxes will work.
One of the lessons learned when making Popups and NotifyIcons in PowerShell and WPF is that the WPF window must be run the the proper context.
I was tipped off to this by Denniver Reining's PowerShell / NotifyIcon article and Johnny J's "Doing a (C#) …
Read MoreSo this happened about a month ago, but I've been out with the flu. Ed Wilson with Microsoft Scripting Guys invited me to write a few articles on WPF, and I excitedly said yes! In the first article of the series, I detail how to Create Pop-ups by Using PowerShell. The example used displayed local hard drive space.
The …
Read MoreIn addition to be able to use base64 for Images in WPF-based PowerShell Forms, you can also use base64 for icons as well. Essentially, you take the base64, convert it to a memory stream, draw an image from that stream, then convert the image to an icon. Finally, you assign the $notify.Icon this new variable.
Just the …
Read MoreI've recently changed my mind on this, but will leave the previous post up in case you want to reposition a WPF popup. If you want a big window to popup in the lower-right corner of the screen, use a WPF Window. WPF Popups are chromeless, it's true, but they are also limiting in how you can move them around, and how …
Read MoreI like to keep interfaces simple and tend to use icons in my GUI designs. Recently, when making a PowerShell GUI to alert myself to alarm status changes in vCenter, I decided to reuse the same icon over and over for different statuses, but I made them meaningful by dynamically changing the color.
The Goal
My ultimate …
Read MoreI'm currently building a notification module to let me know when VMware vCenter alerts go off in my home lab. I plan to share it, and wanted to use a non-standard icon, but didn't want to require a separate download. I knew base64 would be the answer, and ultimately, some C# code from StackExchange helped me figure out …
Read More