mirror of
https://github.com/Micke-K/IntuneManagement.git
synced 2026-09-28 19:05:38 +02:00
IntuneManagement 4.0.0-beta1
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
param([switch]$ShowUI)
|
||||
|
||||
# Linux: xrdp/XFCE sessions often leave XDG_RUNTIME_DIR (and sometimes
|
||||
# DBUS_SESSION_BUS_ADDRESS) unset. Without them the Avalonia UI can't reach
|
||||
# xdg-desktop-portal, so file dialogs fall back to the oversized managed picker
|
||||
# and "open in browser" fails. Point them at the standard runtime dir / bus when
|
||||
# present, before the module (and Avalonia) initialize.
|
||||
if (-not $IsWindows) {
|
||||
try {
|
||||
$uid = (& id -u).Trim()
|
||||
if ([string]::IsNullOrEmpty($env:XDG_RUNTIME_DIR) -and (Test-Path "/run/user/$uid")) {
|
||||
$env:XDG_RUNTIME_DIR = "/run/user/$uid"
|
||||
}
|
||||
if ([string]::IsNullOrEmpty($env:DBUS_SESSION_BUS_ADDRESS) -and $env:XDG_RUNTIME_DIR -and (Test-Path "$($env:XDG_RUNTIME_DIR)/bus")) {
|
||||
$env:DBUS_SESSION_BUS_ADDRESS = "unix:path=$($env:XDG_RUNTIME_DIR)/bus"
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
Import-Module ($PSScriptRoot + "\IntuneManagement.psd1") -Force
|
||||
|
||||
if($ShowUI -eq $true) {
|
||||
Show-IMMainWindow -View "IntuneManagement"
|
||||
}
|
||||
Reference in New Issue
Block a user