Fix system execution possible issue

#22
pull/23/head
Romain 2022-03-08 00:20:48 +01:00
parent d951f4f9d3
commit 4423ef7891
1 changed files with 5 additions and 5 deletions

View File

@ -57,8 +57,8 @@ function Write-Log ($LogMsg,$LogColor = "White") {
function Start-NotifTask ($Title,$Message,$MessageType,$Balise) { function Start-NotifTask ($Title,$Message,$MessageType,$Balise) {
#Add XML variables #Add XML variables
[xml]$ToastTemplate = @" [xml]$ToastTemplate = @"
<toast launch="ms-get-started://redirect?id=apps_action"> <toast launch="ms-get-started://redirect?id=apps_action">
<visual> <visual>
<binding template="ToastImageAndText03"> <binding template="ToastImageAndText03">
@ -246,7 +246,7 @@ function Start-WAUUpdateCheck{
else{ else{
#Get Github latest version #Get Github latest version
$WAUurl = 'https://api.github.com/repos/Romanitho/Winget-AutoUpdate/releases/latest' $WAUurl = 'https://api.github.com/repos/Romanitho/Winget-AutoUpdate/releases/latest'
$LatestVersion = (Invoke-WebRequest $WAUurl | ConvertFrom-Json)[0].tag_name $LatestVersion = (Invoke-WebRequest $WAUurl -UseBasicParsing | ConvertFrom-Json)[0].tag_name
[version]$AvailableVersion = $LatestVersion.Replace("v","") [version]$AvailableVersion = $LatestVersion.Replace("v","")
#If newer version is avalable, return $True #If newer version is avalable, return $True
@ -264,7 +264,7 @@ function Start-WAUUpdateCheck{
function Update-WAU{ function Update-WAU{
#Get WAU Github latest version #Get WAU Github latest version
$WAUurl = 'https://api.github.com/repos/Romanitho/Winget-AutoUpdate/releases/latest' $WAUurl = 'https://api.github.com/repos/Romanitho/Winget-AutoUpdate/releases/latest'
$LatestVersion = (Invoke-WebRequest $WAUurl | ConvertFrom-Json)[0].tag_name $LatestVersion = (Invoke-WebRequest $WAUurl -UseBasicParsing | ConvertFrom-Json)[0].tag_name
#Send available update notification #Send available update notification
$Title = $NotifLocale.local.outputs.output[2].title -f "Winget-AutoUpdate" $Title = $NotifLocale.local.outputs.output[2].title -f "Winget-AutoUpdate"
@ -312,7 +312,7 @@ function Update-WAU{
Start-NotifTask $Title $Message $MessageType $Balise Start-NotifTask $Title $Message $MessageType $Balise
#Rerun with newer version #Rerun with newer version
Write-Log "Re-run WAU" Write-Log "Re-run WAU"
Start-Process powershell -ArgumentList "-ExecutionPolicy Bypass -Command `"$WorkingDir\winget-upgrade`"" Start-Process powershell -ArgumentList "-ExecutionPolicy Bypass -Command `"$WorkingDir\winget-upgrade`""
exit exit
} }