ci: fix broken windows tool
Queue Release Build / prepare (push) Successful in 1m54s
Queue Release Build / build-windows (push) Successful in 30m48s
Queue Release Build / build-linux (push) Successful in 44m39s
Queue Release Build / build-android (push) Successful in 20m7s
Queue Release Build / finalize (push) Successful in 1m0s
Deploy Web Apps / deploy (push) Successful in 6m28s

This commit is contained in:
2026-08-14 11:25:56 +02:00
parent 1ce72e7ac3
commit 9429dacac5
2 changed files with 61 additions and 4 deletions
+10
View File
@@ -9,6 +9,16 @@ param(
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
# Reading IIS configuration (redirection.config) and creating sites needs a full
# administrator token. An interactive logon gets a UAC-filtered one, which fails
# later with a confusing "cannot retrieve the dynamic parameters" error.
$currentIdentity = [Security.Principal.WindowsIdentity]::GetCurrent()
$currentPrincipal = [Security.Principal.WindowsPrincipal]::new($currentIdentity)
if (-not $currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
throw "IIS deployment requires an elevated administrator token, but '$($currentIdentity.Name)' does not have one. Add the runner account to the local Administrators group and run the Gitea runner as a Windows service."
}
try {
Import-Module WebAdministration -ErrorAction Stop
} catch {