Private Repo for IcingaForWindows with Authentication

Is there a way to use a private repository location that uses authentication. I would like to pass an authentication header to the web requests, that download the needed files. Adding a header with user and password to the Invoke-WebRequest commands in IcingaForWindows.ps1 seems not to work, as the called Start-IcingaForWindowsInstallation.psm1 still wants to download files without authentication header from the repository. I get:

[Notice]: Starting Icinga for Windows installation
[Notice]: Repository “Icinga Stable” is already registered. Forcing override of data.
[Error]: The remote host “https://icingaweb-server/IcingaForWindows/stable/ifw.repo.json” send an exception response “401”: “The remote server returned an error: (401) Unauthorized.”

Since this is meant for:
https://packages.icinga.com/IcingaForWindows/stable/ifw.repo.json

which uses no authentification →

  • not without a feature request since the powershell framework uses webrequests without any credentials

but this seems promising:

which means you can copy the repository to the local machine using your powershell code and authentification and use the local path which can be set in the repository json file.