Cake build - Specify MSBuild version to be used for build

Today when I started on a setup for my project, I started seeing multiple errors on the build (which made no sense :| ). After some research, I found out that I needed the MSBuild 2017 version for this to work. Although I installed the Visual Studio Build Tools 2017 the build was still failing, as the build was using the MSBuild from my Visual Studio 2022.