Files
PowerBGInfoPCI-COMPLIANT/Copy-PowerBGInfoPCI-COMPLIANT.ps1

41 lines
1.6 KiB
PowerShell

# ============================================================
# LOG
# ============================================================
$LogPath = Join-Path $PSScriptRoot "install.log"
Start-Transcript -Path $LogPath -Append
# ============================================================
# CONFIG
# ============================================================
$BaseUrl = "https://repo.luckyden.org/admin_tan/PowerBGInfoGlobal/raw/branch/main"
$DataPath = "C:\ProgramData\PowerBGInfo"
$WallpaperPath = "$DataPath\img19-resize.jpg"
# ============================================================
# DOSSIERS
# ============================================================
if (!(Test-Path $DataPath)) {
New-Item -ItemType Directory -Path $DataPath -Force
}
# ============================================================
# DOWNLOAD
# ============================================================
Invoke-WebRequest "$BaseUrl/Set-WallpaperPowerBGInfoPCI-COMPLIANT.ps1" -OutFile "$DataPath\Set-WallpaperPowerBGInfoPCI-COMPLIANT.ps1"
Invoke-WebRequest "$BaseUrl/Set-ScheduledTaskPowerBGInfoPCI-COMPLIANT.ps1" -OutFile "$DataPath\Set-ScheduledTaskPowerBGInfoPCI-COMPLIANT.ps1"
Invoke-WebRequest "$BaseUrl/img19-resize.jpg" -OutFile $WallpaperPath
# ============================================================
# CREATE SCHEDULED TASK
# ============================================================
& "$DataPath\Set-ScheduledTaskPowerBGInfoPCI-COMPLIANT.ps1"
# ============================================================
# FIRST RUN
# ============================================================
& "$DataPath\Set-WallpaperPowerBGInfoPCI-COMPLIANT.ps1"
Stop-Transcript