Update StackMonkey.ps1

This commit is contained in:
2025-10-16 19:51:50 -04:00
parent 813bf98d0d
commit a05f4e742a

View File

@@ -1859,12 +1859,12 @@ function Install-DattoRMM {
$url = "http://localhost:$Port/"
Write-LogHybrid "Starting ScriptMonkey UI on $url" Info Startup
# Resolve Edge path explicitly (works in both 32/64-bit installs)
# Resolve Edge path explicitly (x86 first, then 64-bit, then PATH)
$edgeCandidates = @(
"${env:ProgramFiles(x86)}\Microsoft\Edge\Application\msedge.exe",
"$env:ProgramFiles\Microsoft\Edge\Application\msedge.exe
"$env:ProgramFiles\Microsoft\Edge\Application\msedge.exe"
)
$edgePath = ($edgeCandidates | Where-Object { Test-Path $_ } | Select-Object -First 1)
$edgePath = $edgeCandidates | Where-Object { $_ -and (Test-Path $_) } | Select-Object -First 1
if (-not $edgePath) {
$cmd = Get-Command -Name 'msedge.exe' -ErrorAction SilentlyContinue
if ($cmd) { $edgePath = $cmd.Path }
@@ -1872,7 +1872,7 @@ function Install-DattoRMM {
# Launch Edge (app mode) in a background job so Start-Server can block
Start-Job -Name 'OpenScriptMonkeyUI' -ScriptBlock {
param($u, $edge)
param([string]$u, [string]$edge)
Start-Sleep -Milliseconds 400
try {
if ($edge -and (Test-Path $edge)) {
@@ -1886,6 +1886,8 @@ function Install-DattoRMM {
# Now start the blocking listener loop
Start-Server
return
}
}