Install Unity with Gitlab-Runner through Powershell failing with Error Code 2

Hi everyone and the Unity-Team,

like the titel is saying I am trying to install the Unity Editor through the Powershell with the Gitlab-Runner and using the Tool from Microsoft for this:
https://github.com/microsoft/unitysetup.powershell

and it does crash during the process in line 927 and the error code is handled in line 930:

It returns with Error Code 2 what is the meaning of this?
The PowerShell is running with Admin rights, this can’t be a permission issue?

The Log of the run can be seen here:

What I also tried was to run the script myself on the runner machiene and it worked with the only difference that in my powershell environment the noninteractive mode is disabled and I had to accept the installation myself. But thats not a option here.

Anyone who could help or could point me in some directions to find the issue?

Best Regards

Hello @martin-unity ,

I am sorry to bother you again.
Recently we where in a dialog about my issue here: Unity startup time via CLI much longer on offline machine despite activated license

And like I said I wanted to get back to you after I have automated our Unity-Setup for our pipeline runners.
Unfortunatly I am stuck again and I could need some internal help from you again to proceed.

You can see my issue above but especially I am interested what the ExitCode 2 of the UnitySetup64-2021.3.16f1.exe means with what the installer returns after starting it.

If I run it myself with the Powershell I get a dialog if I want to install it and the rest of the script runs through.
But if run via the Gitlab-Runner which also uses the Powershell but in noninteractive mode this ErrorCode is returned instead.
Thats done on the same machine.

Could you have some advice what I could check?