wingetautoupdate/Winget-AutoUpdate/functions/Get-WAUConfig.ps1

26 lines
664 B
PowerShell
Raw Normal View History

2022-04-13 16:50:06 +00:00
#Function to get WAU Configs
2022-04-05 13:17:18 +00:00
function Get-WAUConfig{
2022-04-24 08:51:51 +00:00
#Get config file
2022-04-05 13:17:18 +00:00
[xml]$WAUConfig = Get-Content "$WorkingDir\config\config.xml" -Encoding UTF8 -ErrorAction SilentlyContinue
#Check if WAU is configured for Black or White List
if ($true -eq [System.Convert]::ToBoolean($WAUConfig.app.UseWAUWhiteList)){
$Script:UseWhiteList = $true
}
else{
$Script:UseWhiteList = $false
}
2022-04-24 08:51:51 +00:00
#Get Notification Level
if ($WAUConfig.app.NotificationLevel){
$Script:NotificationLevel = $WAUConfig.app.NotificationLevel
}
else{
#Default: Full
$Script:NotificationLevel = $full
}
2022-04-13 16:51:21 +00:00
}