Prevent NuGet package vulnerabilities from breaking the build
TL;DR: If you enable “Treat warnings as errors” in your .NET projects, NuGet audit warnings for security vulnerabilities may break your build, but there are ...
TL;DR: If you enable “Treat warnings as errors” in your .NET projects, NuGet audit warnings for security vulnerabilities may break your build, but there are ...
I started listening to podcasts in the summer of 2023, and have been enjoying them while walking my dogs or exercising ever since. I have found them to be a ...
Over the past couple days I’ve been updating a .NET 8 solution from using System.Data.SqlClient to Microsoft.Data.SqlClient. The reason for this, besides the...
I had heard the PowerShell term “type accelerators” a few times, but never really knew what that meant. I finally decided to check out the about_Type_Acceler...
Somehow I missed it, but for years Visual Studio has had a built-in EditorConfig editor. I would typically edit my .editorconfig file in VS Code using just t...
Performing retries to make your code more resilient is a common pattern. By leveraging a PowerShell ScriptBlock, we can create a function to avoid constantly...
There are a lot of different windows for configuring various settings in Windows. Unfortunately, finding the right window is not always easy. The Windows Set...
Code formatting can be a very personal choice. Some languages are very strict and enforce specific indentation and brace styles, while many others allow for ...
I spin up new PowerShell scripts all the time, whether just for quickly experimenting and testing things out, or for projects that I know will be around for ...
I’m sitting in the airport waiting for my return flight after what has been an awesome week at the PowerShell + DevOps Global Summit 2024, North American edi...
I recently discovered the awesome Format Files VS Code extension that allows you to format all files in your workspace. Typically you would need to open each...
The Azure portal has a Service Retirement Workbook that shows all of the services you are using which are being retired within the next few years. This could...
Here I present a few ways to explore your Azure resources, for when the portal’s search and filter functionality is not enough.
I was recently invited to be a guest on The PowerShell Podcast (Podbean) (YouTube playlist) (Apple Podcasts). I had a great time talking with Andrew Pla, and...
In this post I’ll show different approaches to setting up your build and deployment workflows with GitHub Actions, as well as some pros and cons of each.
I’ve wasted countless hours troubleshooting exceptions thrown by the .NET First, Single, and SingleOrDefault methods. In this post we’ll look at why these me...
In this post we’ll see how to resolve a file or directory path, even if it does not exist.
There are 3 different approaches that can be used to define classes and enums in PowerShell. This article will compare the pros, cons, and performance of eac...
There are a lot of great PowerShell tips out there, but we often don’t proactively look for them. It’s hard to know what you don’t know, and easy to miss out...
Premature optimization may be the root of all evil, but that doesn’t mean you shouldn’t optimize your code where it matters. Rather than guessing which code ...
Developing PowerShell scripts and modules that reference classes and binary modules can be a bit painful, as in order to load a new version of the class or m...
I recently created a PowerShell script module that defines classes and enums. Everything worked fine locally, but broke when I tested the module on a build s...
In this post we see how to extend a Blazor component to show additional UI elements around it, how to override some of the default property settings, and how...
I use Oh My Posh to improve my PowerShell terminal’s prompt appearance and show additional helpful information. There are many themes to choose from, and I h...
Caching is used to improve the performance of an application. When applied properly, caches can also help increase an application’s fault tolerance, helping ...
Carnac is a free, open source, small utility that displays the keys you press on the screen. This is great for demos, presentations, and screen recordings wh...
This post is a collection of Visual Studio Code settings that I think are worth changing from their default values. This only includes native VS Code setting...
When an app running as Admin has focus, you may not be able to trigger your AutoHotkey (AHK) scripts, hotkeys, and hotstrings. This is a security feature of ...
The Windows context menu provides an Edit Script option for AutoHotkey .ahk files. Unfortunately, it defaults to opening in Notepad, which is not a great edi...
I was looking for a way to run a PowerShell script as another user in our deployment pipeline. There are many reasons you might want to do this; for me I nee...
My computer was sometimes very slow and unresponsive. It turned out the Windows power settings were throttling my processor speed.
I installed all my Windows apps on my new computer with one line using WinGet.
Conventional Commits and Conventional Comments can save you and your team time and prevent miscommunications by expressing intent more clearly. Let’s look at...
Sometimes services hosted in IIS don’t behave as we expect and we need to dig into what’s happening. If the problem lies in your application’s code, you may ...
When a file or directory is in use by a process (application), you will not be able to delete or modify the file / directory. Unfortunately it’s not always o...
Copying and pasting is a common task that pretty much everyone does. Becoming more efficient with it is a great way to improve your productivity.
What is EditorConfig
Like many people, I use my laptop for both personal and work projects. One thing I noticed a while back was that the commits to my work Git repos were using ...
If you use PowerShell then this tip is for you; if you don’t already know it, it’s game changer!
So many Zoom windows to close every day
AutoHotkey (AHK) is an amazing programming language for automating tasks and keystrokes in Windows. In this post we’ll look at how you can get your first AHK...
I’ve noticed that VS Code sometimes detects conflicts between my local Git tags and remote ones. This results in a Git error when hitting the small Git sync ...
Your time is valuable, and limited. Many videos we watch, whether they’re conference sessions, DIY instructions, movies, or silly cat videos, can easily be u...
I decided to try out the new Windows Terminal to see how it compared to ConEmu, which is my usual console. The recommended way to get the Windows Terminal is...
We setup a new Visual Studio Database Project using SSDT (SQL Server Data Tools) and built it, which generates a .dapac file that can be used for deployments...
I’m a fan of semantic versioning, especially for software meant to be consumed by other developers, such as NuGet packages. If you want to use semantic versi...
I’m a huge fan of Microsoft’s Azure DevOps. As a developer, it’s a single place that allows me to do everything. It stores my code, tracks my project ideas a...
The Microsoft Ignite 2019 conference has ended, and you know what that means. Time to mass download all the sessions you missed!
I’m lucky enough to attend the Microsoft Ignite 2019 conference this year, and do a pre-conference workshop. The workshop I chose to do was Build your first ...
I’ve been writing code since 1999; professionally since 2009. For many years I put in 60+ hours a week at my job. I was young. I was committed. And most impo...
It had been a while since I created a new console app from scratch, and all of my previous ones had been .Net Framework console apps, so when I needed to mak...
Creating PowerShell Core cmdlets in C# is actually quite easy, especially when you have a great blog post like this one to reference. There is also some offi...
When creating a WPF application, one of the best things you can do upfront is add some code to catch any unhandled exceptions. There are numerous ways unhand...
Note: Pester v5 was released which made breaking changes. The code shown here works with Pester v4 and previous, but not v5. I’m hoping to update this pos...
If you’ve ever deleted an email by accident and had to hunt it down in your Outlook Deleted Items folder to recover it, this tip is for you! You can have Out...
You may have noticed my blog has a very different look now! It used to look like this.
We use quite a few custom PowerShell scripts in some of our builds and releases. This led me to ask the question, which PowerShell log levels actually get wr...
When trying to create a Visual Studio 2017 version of my Diff All Files Visual Studio extension, I was encountering a runtime error indicating that a module ...
ClickOnce applications are a great and easy way to distribute your applications to many users, and have the advantage of offering automatic application updat...
There are many project types that require a .pfx file in order to build and/or publish successfully, such as ClickOnce and UWP (Universal Windows Platform) a...
Why I needed to throttle the number of Tasks running simultaneously
I created the Invoke-MsBuild PowerShell Module (also available in the PowerShell Gallery), and recently added support to use the Visual Studio 2015 version o...
If you search for ways to zip and unzip files using PowerShell, you will find that there a lot of different methods. Some people invoke .Net 4.5 assembly met...
If you use Sql Server Management Studio (SSMS) with multiple monitors, you likely run into the issue where the “Connect to Server” dialog window opens up eit...
One of our SQL servers was running low on disk space and I needed to quickly find the largest files on the drive to know what was eating up all of the disk s...
I originally included this as a small bonus section at the end of my other post about fixing the issue of not being able to run a PowerShell script whose pat...
I recently created my first Visual Studio extension, Diff All Files, which allows you to quickly compare the changes to all files in a TFS changeset, shelves...
Get the source code
I love creating tools, particularly ones for myself and other developers to use. A common situation that I run into is needing to save the user’s settings to...
We had recently started getting lots of error messages similar to the following on our TFS Build Servers:
If you follow my blog then you already know I’m a huge fan of AutoHotkey (AHK), and that I created the AHK Command Picker to allow me to have a limitless num...
If you’ve used binding at all in WPF then you more then likely have also written a converter. There are lots of tutorials on creating converters, so I’m not ...
March 2023 Update: I’ve found another solution that I prefer over this one. See this post for details.
Aside - This post has received many tangential questions in the comments. Your best bet at getting an answer to those questions is to check Stack Overflow an...
Myself and a few co-workers have updated from Windows 8 to Windows 8.1 and have run into some weird problems. After a bit of Googling I have found that we ar...
What are parameter sets anyways?
Here’s some simple code that will throw an exception if the client running your script is not using the version of PowerShell (or greater) that is required; ...
A while ago I created a Path Length Checker tool in C# that has a “nice” GUI, and put it up on CodePlex. One of the users reported that he was trying to use ...
I recently refactored some of our PowerShell scripts that we use to publish and remove IIS 7 web applications, creating some general functions that can be us...
I’m fortunate enough to work for a great company that tries to stay ahead of the curve and use newer technologies. This means that when I’m writing my PowerS...
I recently read a great article that explained how to create hashtables, dictionaries, and PowerShell objects. I already knew a bit about these, but this art...
I thought I’d share some PowerShell (PS) functions that I wrote for some clean-up scripts at work. I use these functions to delete files older than a certain...
When trying to upload my last blog post from Windows Live Writer (WLW) to WordPress (WP) I received the following error:
A few weeks ago I blogged about how you can get custom TFS checkin policies to work when committing from the command line. In that post, I had a quick aside ...
TL;DR - PowerShell needs centralized package management. Please go up-vote this request to have it added to PowerShell.
Update: I show how to have your checkin policies automatically update the registry keys shown in this blog post on this newer blog post. If you are not the p...
In the preamble of an earlier post I mentioned that one of the little things that bugs me about Windows PowerShell ISE is that you can add tabs to the start ...
So you’ve got a super awesome library/assembly that you want to share with others, but you’re too lazy to actually use NuGet to package it up and upload it t...
I’ve written some code that you can add to your ISE profile that adds keyboard shortcuts to quickly comment and uncomment lines in PowerShell ISE. So you can...
I know this isn’t programming related (and thus doesn’t quite go with the theme of my blog), but I thought I’d share an Pass this along to anybody you know t...
I’ve spent a good chunk of time investigating how NuGet.exe works and creating a PowerShell script called New-NuGetPackage to make it dirt simple to pack and...
Most people will likely find the “Run script path with spaces from File Explorer” (to be able to double click a PS script whose path contains spaces to run i...
A while back I wrote about some reasons why I didn’t like GWB (Geeks With Blogs) and was attracted to WordPress. 6 months later and I am confident that I mad...
I’m new to working with Xml through PowerShell and was so impressed when I discovered how easy it was to read an xml element’s value. I’m working with readin...
There are a few different ways to create zip files in powershell, but not many that allow you to create one that is password protected. I found this post tha...
I love PowerShell, and when prompting users for input I often prefer to use GUI controls rather than have them enter everything into the console, as some thi...
Update: I’ve moved this project to it’s own new home at https://invokemsbuild.codeplex.com. All updates will be made there.
We recently upgraded from VS (Visual Studio) 2010 to VS 2012, and with it had to upgrade our .dbproj database project to a .sqlproj. When making the switch I...
A while ago I blogged about a powershell script I made that would automatically update your ClickOnce project file’s Minimum Required Version to the latest v...
I love AutoHotkey (AHK). Ever since I discovered it a little over a year ago I am constantly surprised and pleased with what I am able to accomplish with it....
Hey everyone, I know many of us regularly use Sharepoint for document storage in order to make documents available to several people, have it version control...
If you are like me and don’t want to have to enter your password each time Windows loads, you can have Windows start up without prompting you to enter a user...
Geeks With Blogs has been good to me, but there are too many tempting things about Word Press for me to stay with GWB. Particularly their statistics features...
Update: Before you go running your script as an admin, see if this less obtrusive fix will solve your problems.
You know you’ve seen it before; somebody sends out a company-wide email (or email to a large diverse audience), and a couple people or small group of people ...
I just thought I’d give readers a heads up that you can use Classic Shell to get the old Windows 7 style of start menu back instead of using the new crappy W...
Update (Feb 10, 2016): I found a NuGet package called simple-config that allows you to dynamically bind a section in your web/app.config file to a strongly t...
Over the past couple years I’ve been keeping track of common SQL Server script commands that I use so I don’t have to constantly Google them. Most of them ar...
Update: Before you go running your script as an admin, see if this less obtrusive fix will solve your problems.
This is a general message for all XNA developers that in XNA 4 it takes typically 1 - 1.5 seconds to create a new BasicEffect object, while only about 100 mi...
Today I was thinking about using a ClickOnce application in my build process. The problem is, when using an installed ClickOnce application (as opposed to a...
If you’ve downloaded the new VS 11 Beta and done any merging, then you’ve probably seen the new diff and merge tools built into VS 11. They are awesome, and ...
Hey everyone, I just discovered this great post yesterday that shows how to have msbuild build projects in parallel :-).
Arrggghhhh TFS and builds! Such a love-hate relationship! So we have our TFS builds setup to both compile our C# projects as well as compile and deploy our T...
I watched an awesome Channel 9 Visual Studio Tips And Tricks video, so I thought I’d share. Some great VS gems in there. Even a few Windows 7 ones, like usin...
James Michael Hare has a lot of awesome C# and .Net related posts, so this is just a little shout out to him (and my own little way of bookmarking his blogs ...
I recently discovered this post which shows how you can programmatically update queries in TFS, which is great for when you make a WIT (Work Item Template) c...
There are a few great features in the TFS Power Tools that I wasn’t aware of, such as TreeDiff which let’s you compare folders (or even entire branches) to s...
Just found a few websites that show some Visual Studio tips that I haven’t seen before, so I thought I’d share:
I came across this great article which talks about simply unloading projects from a solution to make the solution load and build faster in Visual Studio. Thi...
One of the greatest benefits of building your solution flies in MSBuild (vs in Visual Studio directly) is that it doesn’t lock up the Visual Studio UI, which...
I stumbled across this great post showing how you can use the TFS Power Tools to automatically deploy your custom TFS check-in policies to everyone on your t...
With the ability to extend Visual Studio 2010, lots of great extensions have popped up. These not only increase productivity, but make the whole coding exper...
If you have the latest version of the Visual Studio 2010 extension VSCommands you can give your solutions friendly names that display in the window’s title b...
The button to jump directly to a work item by specifying its ID looks to be on the Work Item Tracking toolbar by default in VS / TFS 2010. This button is not...
If you are able to build (compile) the solution on your local machine, but it won’t build on the TFS build server and you are getting an error message simila...
You may be wondering which is the best way to hookup a DependencyProperty’s Callback event handler to handle Value Changed events. The two methods to conside...
At one point or another I’m sure we’ve all been confused as to why our binding won’t work. Here’s a couple things to keep in mind:
So if you are trying to set focus to a WPF element, but are unable to. Here is a quick checklist to go through:
A list of some shortcuts and new features to VS 2010 and C# 4.0: