$PSScriptRoot

pull/678/head
Romain 2024-09-01 15:44:58 +02:00
parent 8a41e74df4
commit 513b459955
1 changed files with 5 additions and 5 deletions

View File

@ -28,7 +28,7 @@ if ( $psversionTable.PSEdition -eq "core" ) {
import-Module -name Appx -UseWIndowsPowershell -WarningAction:SilentlyContinue
}
$Script:WAUConfiguratorVersion = Get-Content ".\Winget-AutoUpdate\Version.txt"
$Script:WAUConfiguratorVersion = Get-Content "$PSScriptRoot\Winget-AutoUpdate\Version.txt"
<# FUNCTIONS #>
@ -183,12 +183,12 @@ function Start-Installations {
if ($WAUUseWhiteList) {
$WAUParameters += "-UseWhiteList "
if ($WAUListPath) {
Copy-Item $WAUListPath -Destination ".\included_apps.txt" -Force -ErrorAction SilentlyContinue
Copy-Item $WAUListPath -Destination "$PSScriptRoot\included_apps.txt" -Force -ErrorAction SilentlyContinue
}
}
else {
if ($WAUListPath) {
Copy-Item $WAUListPath -Destination ".\excluded_apps.txt" -Force -ErrorAction SilentlyContinue
Copy-Item $WAUListPath -Destination "$PSScriptRoot\excluded_apps.txt" -Force -ErrorAction SilentlyContinue
}
}
if ($WAUDesktopShortcut) {
@ -202,7 +202,7 @@ function Start-Installations {
}
#Install Winget-Autoupdate
Start-Process "powershell.exe" -Argument "-NoProfile -ExecutionPolicy Bypass -Command ""& '.\Winget-AutoUpdate-Install.ps1' $WAUParameters""" -Wait -Verb RunAs
Start-Process "powershell.exe" -Argument "-NoProfile -ExecutionPolicy Bypass -Command ""& '$PSScriptRoot\Winget-AutoUpdate-Install.ps1' $WAUParameters""" -Wait -Verb RunAs
}
@ -275,7 +275,7 @@ function Start-Uninstallations ($AppToUninstall) {
#Run Winget-Install -Uninstall
$AppsToUninstall = "'$($AppToUninstall -join "','")'"
Start-Process "powershell.exe" -Argument "-NoProfile -ExecutionPolicy Bypass -Command `".\Winget-AutoUpdate\Winget-Install.ps1 -AppIDs $AppsToUninstall -Uninstall`"" -Wait -Verb RunAs
Start-Process "powershell.exe" -Argument "-NoProfile -ExecutionPolicy Bypass -Command `"$PSScriptRoot\Winget-AutoUpdate\Winget-Install.ps1 -AppIDs $AppsToUninstall -Uninstall`"" -Wait -Verb RunAs
Close-PopUp
}