Fix path issue
This commit is contained in:
17
main.ps1
17
main.ps1
@@ -25,6 +25,13 @@ $xamlUrl = "https://git.svstools.com/cpayne/InstaClientPS/raw/branch/main/layout
|
||||
try {
|
||||
$xamlContent = Invoke-WebRequest -Uri $xamlUrl -UseBasicParsing -ErrorAction Stop
|
||||
[xml]$xaml = $xamlContent.Content
|
||||
$reader = (New-Object System.Xml.XmlNodeReader $xaml)
|
||||
$window = [Windows.Markup.XamlReader]::Load($reader)
|
||||
if (-not $window) {
|
||||
Write-Host "[ERROR] Failed to load XAML window."
|
||||
exit 1
|
||||
}
|
||||
Write-Host "[INFO] WPF window loaded."
|
||||
Write-Host "[INFO] XAML loaded from remote URL."
|
||||
} catch {
|
||||
Write-Host ("[ERROR] Failed to load XAML from {0}: {1}" -f $xamlUrl, $_.Exception.Message)
|
||||
@@ -51,16 +58,6 @@ Add-Type -AssemblyName PresentationCore
|
||||
Add-Type -AssemblyName WindowsBase
|
||||
Add-Type -AssemblyName System.Xaml
|
||||
|
||||
# Load WPF XAML UI
|
||||
[xml]$xaml = Get-Content "$PSScriptRoot\InstaProvision.xaml"
|
||||
$reader = (New-Object System.Xml.XmlNodeReader $xaml)
|
||||
$window = [Windows.Markup.XamlReader]::Load($reader)
|
||||
if (-not $window) {
|
||||
Write-Host "[ERROR] Failed to load XAML window."
|
||||
exit 1
|
||||
}
|
||||
Write-Host "[INFO] WPF window loaded."
|
||||
|
||||
# Map named UI controls
|
||||
$CompanyNameBox = $window.FindName("CompanyNameBox")
|
||||
$PhoneBox = $window.FindName("PhoneBox")
|
||||
|
||||
Reference in New Issue
Block a user