The PC join line says to run it as administrator before anything else runs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -583,6 +583,11 @@ def join_windows(cfg, base):
|
||||
if "$known = @{" not in text:
|
||||
raise RuntimeError("the Windows template changed: cannot put the program finder in")
|
||||
text = text.replace("# Status panel remote access", "# Run in PowerShell as administrator: irm %s/join.ps1 | iex\n# Status panel remote access" % base, 1)
|
||||
# Not elevated: say how, before anything runs (SC's Lighting PC got a DISM error instead, 2026-10-21).
|
||||
text = text.replace("# Status panel remote access", """# Status panel remote access
|
||||
if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
|
||||
throw 'Run this as administrator: close this window, right-click Windows PowerShell > Run as administrator, then paste the line again. Nothing was changed.'
|
||||
}""", 1)
|
||||
text += """
|
||||
# 5. Tell %(ingest)s this PC is here: it sets it up within a minute.
|
||||
$hello = @{ user = $env:USERNAME; name = $env:COMPUTERNAME; os = 'windows'
|
||||
|
||||
Reference in New Issue
Block a user