Better by Romain
parent
55c4efdc69
commit
b9139542ce
|
@ -53,7 +53,7 @@ if ($Logs) {
|
||||||
#Not available yet
|
#Not available yet
|
||||||
$Message = $NotifLocale.local.outputs.output[5].message
|
$Message = $NotifLocale.local.outputs.output[5].message
|
||||||
$MessageType = "warning"
|
$MessageType = "warning"
|
||||||
Start-NotifTask -Message $Message -MessageType $MessageType
|
Start-NotifTask -Message $Message -MessageType $MessageType -UserRun
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif ($Help) {
|
elseif ($Help) {
|
||||||
|
@ -65,7 +65,7 @@ else {
|
||||||
if (Test-WAUisRunning) {
|
if (Test-WAUisRunning) {
|
||||||
$Message = $NotifLocale.local.outputs.output[8].message
|
$Message = $NotifLocale.local.outputs.output[8].message
|
||||||
$MessageType = "warning"
|
$MessageType = "warning"
|
||||||
Start-NotifTask -Message $Message -MessageType $MessageType -Button1Text $Button1Text -Button1Action $OnClickAction -ButtonDismiss
|
Start-NotifTask -Message $Message -MessageType $MessageType -Button1Text $Button1Text -Button1Action $OnClickAction -ButtonDismiss -UserRun
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
#Run scheduled task
|
#Run scheduled task
|
||||||
|
@ -73,7 +73,7 @@ else {
|
||||||
#Starting check - Send notification
|
#Starting check - Send notification
|
||||||
$Message = $NotifLocale.local.outputs.output[6].message
|
$Message = $NotifLocale.local.outputs.output[6].message
|
||||||
$MessageType = "info"
|
$MessageType = "info"
|
||||||
Start-NotifTask -Message $Message -MessageType $MessageType -Button1Text $Button1Text -Button1Action $OnClickAction -ButtonDismiss
|
Start-NotifTask -Message $Message -MessageType $MessageType -Button1Text $Button1Text -Button1Action $OnClickAction -ButtonDismiss -UserRun
|
||||||
#Sleep until the task is done
|
#Sleep until the task is done
|
||||||
While (Test-WAUisRunning) {
|
While (Test-WAUisRunning) {
|
||||||
Start-Sleep 3
|
Start-Sleep 3
|
||||||
|
@ -91,12 +91,12 @@ else {
|
||||||
$MessageType = "success"
|
$MessageType = "success"
|
||||||
$Message = $NotifLocale.local.outputs.output[9].message
|
$Message = $NotifLocale.local.outputs.output[9].message
|
||||||
}
|
}
|
||||||
Start-NotifTask -Message $Message -MessageType $MessageType -Button1Text $Button1Text -Button1Action $OnClickAction -ButtonDismiss
|
Start-NotifTask -Message $Message -MessageType $MessageType -Button1Text $Button1Text -Button1Action $OnClickAction -ButtonDismiss -UserRun
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
#Check failed - Just send notification
|
#Check failed - Just send notification
|
||||||
$Message = $NotifLocale.local.outputs.output[7].message
|
$Message = $NotifLocale.local.outputs.output[7].message
|
||||||
$MessageType = "error"
|
$MessageType = "error"
|
||||||
Start-NotifTask -Message $Message -MessageType $MessageType -Button1Text $Button1Text -Button1Action $OnClickAction -ButtonDismiss
|
Start-NotifTask -Message $Message -MessageType $MessageType -Button1Text $Button1Text -Button1Action $OnClickAction -ButtonDismiss -UserRun
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,16 +11,10 @@ function Start-NotifTask {
|
||||||
[String]$Body,
|
[String]$Body,
|
||||||
[String]$Button1Text,
|
[String]$Button1Text,
|
||||||
[String]$Button1Action,
|
[String]$Button1Action,
|
||||||
[Switch]$ButtonDismiss = $false
|
[Switch]$ButtonDismiss = $false,
|
||||||
|
[Switch]$UserRun = $false
|
||||||
)
|
)
|
||||||
|
|
||||||
$caller = Get-ChildItem $MyInvocation.PSCommandPath | Select-Object -Expand Name
|
|
||||||
if ($caller -eq "User-Run.ps1") {
|
|
||||||
$Title = "Winget-AutoUpdate (WAU)"
|
|
||||||
$Balise = "Winget-AutoUpdate (WAU)"
|
|
||||||
$UserRun = $True
|
|
||||||
}
|
|
||||||
|
|
||||||
if (($WAUConfig.WAU_NotificationLevel -eq "Full") -or ($WAUConfig.WAU_NotificationLevel -eq "SuccessOnly" -and $MessageType -eq "Success") -or ($UserRun)) {
|
if (($WAUConfig.WAU_NotificationLevel -eq "Full") -or ($WAUConfig.WAU_NotificationLevel -eq "SuccessOnly" -and $MessageType -eq "Success") -or ($UserRun)) {
|
||||||
|
|
||||||
# XML Toast template creation
|
# XML Toast template creation
|
||||||
|
|
Loading…
Reference in New Issue