Hard coded notification xml file path

pull/2/head v1.2.1
Romanitho 2022-01-21 18:15:37 +01:00 committed by GitHub
parent 510c49c726
commit 4f29020224
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -1,7 +1,7 @@
#Send Notif Script
#get xml notif config
[xml]$NotifConf = Get-Content "$PSScriptRoot\notif.xml" -Encoding UTF8 -ErrorAction SilentlyContinue
[xml]$NotifConf = Get-Content "C:\ProgramData\winget-update\notif.xml" -Encoding UTF8 -ErrorAction SilentlyContinue
if (!($NotifConf)) {break}
#Load Assemblies

View File

@ -59,7 +59,11 @@ function Start-NotifTask ($Title,$Message,$MessageType,$Balise) {
"@
#Save XML File
$ToastTemplate.Save("$WorkingDir\notif.xml")
$ToastTemplateLocation = "C:\ProgramData\winget-update\"
if (!(Test-Path $ToastTemplateLocation)){
New-Item -ItemType Directory -Force -Path $ToastTemplateLocation
}
$ToastTemplate.Save("$ToastTemplateLocation\notif.xml")
#Send Notification to user
Get-ScheduledTask -TaskName "Winget Update Notify" -ErrorAction SilentlyContinue | Start-ScheduledTask -ErrorAction SilentlyContinue