From a279a255ea518066b63e8124d869106dd6e6dfc1 Mon Sep 17 00:00:00 2001 From: admin_tan Date: Thu, 11 Jun 2026 12:28:58 +0200 Subject: [PATCH] Actualiser Copy-PowerBGInfoGlobal.ps1 --- Copy-PowerBGInfoGlobal.ps1 | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Copy-PowerBGInfoGlobal.ps1 b/Copy-PowerBGInfoGlobal.ps1 index c7a56c0..26b7722 100644 --- a/Copy-PowerBGInfoGlobal.ps1 +++ b/Copy-PowerBGInfoGlobal.ps1 @@ -3,15 +3,15 @@ # ============================================================ $BaseUrl = "https://repo.luckyden.org/admin_tan/PowerBGInfoGlobal/raw/branch/main" -$ModuleDest = "$Env:ProgramFiles\WindowsPowerShell\Modules" - $DataPath = "C:\ProgramData\PowerBGInfo" $WallpaperPath = "C:\Windows\Web\Wallpaper\Windows\img19-resize.jpg" # ============================================================ # DOSSIERS # ============================================================ -New-Item -Path $DataPath -ItemType Directory -Force | Out-Null +if (!(Test-Path $DataPath)) { + New-Item -ItemType Directory -Path $DataPath -Force +} # ============================================================ # DOWNLOAD @@ -20,11 +20,6 @@ Invoke-WebRequest "$BaseUrl/Set-WallpaperPowerBGInfoGlobal.ps1" -OutFile "$DataP Invoke-WebRequest "$BaseUrl/Set-ScheduledTaskPowerBGInfo.ps1" -OutFile "$DataPath\Set-ScheduledTaskPowerBGInfo.ps1" Invoke-WebRequest "$BaseUrl/img19-resize.jpg" -OutFile $WallpaperPath -# ============================================================ -# INSTALL MODULE -# ============================================================ -Expand-Archive -DestinationPath $ModuleDest -Force - # ============================================================ # CREATE SCHEDULED TASK # ============================================================