My first ever product

As part of my goal to write a book I began looking at how to build a following and where to sell the book once it’s finished. On this journey I found Gumroad, a great place to sell digital products. Given my idea to sell a comprehensive library of code snippets besides the actual book I took a look at existing integrations between it and, my preferred git host. [Read More]

Delete Your Old VMware Snapshots

For the love of Pete, please delete your old snapshots regularly! Old snapshots have caused incidents and even outages more than once in my career and it is really easy to preemptively look for them and get them removed before anything happens. Why To put it plainly, they can cause issues - like 03:00 in the morning pager alert issues and additionally eat up storage space like crazy. Degraded performance of the VM having the snapshot Degraded performance to full outages for other VMs on the same data store due to rapidly increasing snapshot sizes VMware recommends a series of steps to reduce risk when using snapshots: [Read More]

How To Find With PowerShell

Finding files, do I even need to describe how important this is?

Finding files, do I even need to describe how important this is? From finding README files in a project $ find . -name README* ./app/ ./ ./ to locating that one config file you never can remember the location of. $ find . -name dnsconf.yaml ./app/module1/dnsconf.yaml Info All commands in this post are run against a open source repository to allow you to reproduce output & play with the commands. [Read More]

Looking back at 2020, Four Months Of Blogging

A look back on four months of blogging and engaging the PowerShell community

The year is coming to an end, with all its ups and downs 2020 surely was challenging to say the least. I wanted to take this time to openly reflect on my first couple months of blogging and what the future holds for PS> $firstPost = Get-Date -Year 2020 -Month 09 -Day 13 PS> $latestPost = Get-Date -Year 2020 -Month 12 -Day 22 PS> New-TimeSpan $firstPost $latestPost | Select-Object Days Days ---- 100 So, how are things going? [Read More]

My Stand On Affiliate Links

What I think about affiliate links

Lets talk about affiliate links for a moment. TLDR: I will use affiliate links where it is possible for me, wich isn’t often to be honest Lets dig into it, starting with some basic assumptions I am making: Most of my posts are technical content where I do not recommend any products or services, so there are no opportunities for affiliate links to begin with In posts where I reference a product or service I do so because I think it is great and I really want to recommend it There are no negative effects for the reader when using my affiliate links There are benefits for me when you use the affiliate link, either monetary or in credit with the service - This helps me keep this blog up and running for everyone to benefit Given those assumptions I don’t see any reason why I should not use affiliate links. [Read More]

Super-Charged Cmdlet Aliases

It works like magic, but it works - Bring your aliasing to a whole other level!

Backstory I recently wrote a post about PowerShell Aliasing for the folks over at ScriptRunner. The one issue I had while researching for this post was this: You can not create a alias for a function and overwrite one of it’s parameters at the same time while keeping nice features like tab-complete. For a concrete example of this visit please look at the original post. At the end of the post I asked if anyone had a solution to this problem - and the internet delivered! [Read More]

Why You Want To Install PowerShell On Windows

Why installing PowerShell on Windows may actually be a good idea

Q: Wait a minute! Don’t I already have PowerShell? A: Yes. However you may want to continue reading because things are never as simple as they appear. The PowerShell version you have installed on Windows 10 is 5.X, Microsoft even says so in their own documentation. On the initial release of Windows 10, with automatic updates enabled, PowerShell gets updated from version 5.0 to 5.1. If the original version of Windows 10 is not updated through Windows Updates, the version of PowerShell is 5. [Read More]

Collections and Randomization

Randomize Collections in PowerShell

Randomizing a collection is useful in a variety of situations and in most languages it is fairly straight forward. For example Python my_list = range(1,20) random.shuffle(my_list) PHP $numbers = range(1, 20); shuffle($numbers); In PowerShell this works a bit differently. Before 7.1 PS> @(1,2,3) | Sort-Object {Get-Random} 3 1 2 PS> "abc".ToCharArray() | Sort-Object {Get-Random} a c b Well, how does that work? Sort-Object allows us to sort the incoming collection based on a script block. [Read More]

How To Grep With PowerShell

It's just like Bash, but more powerful!

Filtering data, from log or config files to data returned by an api, is an important operation to remove noise from it and make further analysis possible. In Bash most would gravitate towards grep, egrep or awk. Classic examples would be looking at your history $ history | grep ssh ssh marco@ ssh deploy@ ssh admin@ looking for errors in a log $ cat /var/log/app.log | grep error 2020-09-30 09:01:17 error: twitter api responded with 403 2020-09-30 09:16:05 error: secret plan to take over the world failed grep $ grep api app. [Read More]