Fix path issue

This commit is contained in:
Chris Payne
2025-07-08 19:45:02 -04:00
parent dcfa569a7e
commit 7f4ec40a91

View File

@@ -25,6 +25,13 @@ $xamlUrl = "https://git.svstools.com/cpayne/InstaClientPS/raw/branch/main/layout
try { try {
$xamlContent = Invoke-WebRequest -Uri $xamlUrl -UseBasicParsing -ErrorAction Stop $xamlContent = Invoke-WebRequest -Uri $xamlUrl -UseBasicParsing -ErrorAction Stop
[xml]$xaml = $xamlContent.Content [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." Write-Host "[INFO] XAML loaded from remote URL."
} catch { } catch {
Write-Host ("[ERROR] Failed to load XAML from {0}: {1}" -f $xamlUrl, $_.Exception.Message) 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 WindowsBase
Add-Type -AssemblyName System.Xaml 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 # Map named UI controls
$CompanyNameBox = $window.FindName("CompanyNameBox") $CompanyNameBox = $window.FindName("CompanyNameBox")
$PhoneBox = $window.FindName("PhoneBox") $PhoneBox = $window.FindName("PhoneBox")