In 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 MoreA while back, I wrote about High-Performance Techniques for Importing CSV to SQL Server using PowerShell. Earlier today, I released a PowerShell module, CsvSqlImport.psm1, which puts that post into practice.
Using this module, it's possible to import over 90,000 records a second in optimized environments. In addition …
Read MoreNo idea where I got this (it's been in Drafts forever), and now I kinda want to do it in PowerShell, but here's some T-SQL to drop a hella stuck database (if plain old restore database @dbname doesn't work).
1DECLARE @dbname sysname 2DECLARE @spid int 3DECLARE @dbid int 4SET @dbname = 'big' 5 6SELECT …
Read MoreIt's obvious that I love PowerShell and SQL Server. Together, they allow SQL Server DBA's to solve just about any problem. Most of my projects have come from questions posted in Reddit's SQL Server subreddit, including my most recent project, Reset-SqlSaPassword, which allows you to regain syadmin access to your SQL …
Read MoreGetting the total number of inserted rows for SqlBulkCopy should be easier, but I believe the easiest (and fastest) is by using reflection and some C# code within your PowerShell script. Thanks to user601543 at stackoverflow, I was able translate his code for use within one of my own scripts. …
Read MoreRecently, I did a webcast for the PowerShell Virtual Chapter of PASS on Simplifying SQL Server Migrations using PowerShell. If you're planning for a SQL Server migration, I wrote a bunch of scripts that can help, and put them all on github.
Check out the sqlmigration repository, and the accompanying PowerPoint Slides. …
Read MoreEach morning when I get into the office, I check performance graphs in SolarWinds Database Performance Analyzer (DPA - formerly Confio Ignite). Monday mornings are usually the most important, because I run full system maintenance on a specific monitored database on Sunday. Monday is the first day of heavy utilization …
Read More