The personal blog of Jamie Phillips

A blog about software development and other random musings.

Memoization in PowerShell

I have been working on improving my Computer Science knowledge, it has grown over the years, and I know that improving it will help my imposter syndrome. With that said, I have been spending my time reading Classic Computer Science Problems in Python, this is a fantastic book, and I am confirming what I do know and learning all kinds of new information. One of the first exercises is about recursion and how you can leverage memoization to save some calculation time. I find that I learn best by taking it and applying to other languages that I know, so I decided that applying it in PowerShell sounded like fun. The problem that you use recursion to solve is a Fibonacci calculator.

Create more resilient PowerShell scripts on Linux

I had previously written this post on how to execute PowerShell scripts from Bash. In that post, I discussed how to add the shebang at the start of your script that will be ignored on non-Linux systems, but on Linux systems, it will provide the path to the interpreter you want to use, in our case it would be PowerShell. Here is a simple example:

How To Configure an Alias for The .NET SDK Snap

Snaps are packages that allow easy, agnostic, and sandboxed installation of applications on Linux. This will enable you to be able to install the same app across any Linux distribution that supports Snap packages. To aid you in working with Microsoft applications, they have started creating Snaps for PowerShell, Visual Studio Code, and the .NET SDK. The PowerShell and Visual Studio Code Snaps operate as one would expect, however, the .NET SDK Snap doesn't perform as you would expect. Due to the nature of the sandboxing technology used by Snaps, the commands for the application are structured as follows: application-name.command. What this means is that to call the .NET SDK on the command line, you will need to execute the following command: