CMAKE uses CMD or Powershell depending on Computer

The Problem:
When executing CMAKE the generated Build-Commands use either the cmd or powershell cli.
This can cause errors with long build command, as cmd has a much smaller character limit.
The shell that will be used seems to differ per PC.

We are using:
cmake version 3.19.6
GNU Make 4.1

What we tried:
When using the CMAKE build task, on some PCs it works and on some it won´t work.
When using a single build command from the compile_commands.json it works on every PC.
When the Build fails it will cite not finding certain includes as the cause for the error,
leading us to believe that certain include-paths will be cut off due to the cmd character limit.

My Questions:
On what does the selection of the shell depend?
Is this problem exclusive to Windows?
Is it possible to force CMAKE to use Powershell?