Update StackMonkey.ps1
This commit is contained in:
@@ -1859,12 +1859,12 @@ function Install-DattoRMM {
|
|||||||
$url = "http://localhost:$Port/"
|
$url = "http://localhost:$Port/"
|
||||||
Write-LogHybrid "Starting ScriptMonkey UI on $url" Info Startup
|
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 = @(
|
$edgeCandidates = @(
|
||||||
"${env:ProgramFiles(x86)}\Microsoft\Edge\Application\msedge.exe",
|
"${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) {
|
if (-not $edgePath) {
|
||||||
$cmd = Get-Command -Name 'msedge.exe' -ErrorAction SilentlyContinue
|
$cmd = Get-Command -Name 'msedge.exe' -ErrorAction SilentlyContinue
|
||||||
if ($cmd) { $edgePath = $cmd.Path }
|
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
|
# Launch Edge (app mode) in a background job so Start-Server can block
|
||||||
Start-Job -Name 'OpenScriptMonkeyUI' -ScriptBlock {
|
Start-Job -Name 'OpenScriptMonkeyUI' -ScriptBlock {
|
||||||
param($u, $edge)
|
param([string]$u, [string]$edge)
|
||||||
Start-Sleep -Milliseconds 400
|
Start-Sleep -Milliseconds 400
|
||||||
try {
|
try {
|
||||||
if ($edge -and (Test-Path $edge)) {
|
if ($edge -and (Test-Path $edge)) {
|
||||||
@@ -1886,6 +1886,8 @@ function Install-DattoRMM {
|
|||||||
# Now start the blocking listener loop
|
# Now start the blocking listener loop
|
||||||
Start-Server
|
Start-Server
|
||||||
return
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user