Rename layout
This commit is contained in:
32
main.ps1
32
main.ps1
@@ -14,9 +14,35 @@ Import-Module MSAL.PS
|
||||
Write-Host "[INFO] MSAL.PS module loaded."
|
||||
|
||||
# Load config and tool modules
|
||||
. "$PSScriptRoot\config.ps1"
|
||||
. "$PSScriptRoot\tools\autotask.ps1"
|
||||
. "$PSScriptRoot\tools\dattormm.ps1"
|
||||
$urls = @{
|
||||
autotask = "https://git.svstools.com/cpayne/InstaClientPS/raw/branch/main/tools/autotask.ps1"
|
||||
datto = "https://git.svstools.com/cpayne/InstaClientPS/raw/branch/main/tools/dattormm.ps1"
|
||||
config = "https://git.svstools.com/cpayne/InstaClientPS/raw/branch/main/config.ps1"
|
||||
}
|
||||
|
||||
$xamlUrl = "https://git.svstools.com/cpayne/InstaClientPS/raw/branch/main/layout.xaml"
|
||||
|
||||
try {
|
||||
$xamlContent = Invoke-WebRequest -Uri $xamlUrl -UseBasicParsing -ErrorAction Stop
|
||||
[xml]$xaml = $xamlContent.Content
|
||||
Write-Host "[INFO] XAML loaded from remote URL."
|
||||
} catch {
|
||||
Write-Host ("[ERROR] Failed to load XAML from {0}: {1}" -f $xamlUrl, $_.Exception.Message)
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
foreach ($name in $urls.Keys) {
|
||||
try {
|
||||
$scriptText = Invoke-WebRequest -Uri $urls[$name] -UseBasicParsing
|
||||
Invoke-Expression $scriptText.Content
|
||||
Write-Host "[INFO] Loaded $name.ps1 from URL."
|
||||
} catch {
|
||||
Write-Host "[ERROR] Failed to load $name.ps1: $($_.Exception.Message)"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "[INFO] Config and tool modules loaded."
|
||||
|
||||
# Load WPF assemblies
|
||||
|
||||
Reference in New Issue
Block a user