Update scheduled task to use Powershell 7

Todo: add logic to check for and install Powershell 7
This commit is contained in:
2026-10-07 15:48:27 +00:00
parent d3ab05416d
commit 3b1aee7016
+1 -1
View File
@@ -59,7 +59,7 @@ $scriptPath = Join-Path $InstallDir 'Send-VeeamBackupStatus.ps1'
Copy-Item -Path (Join-Path $PSScriptRoot 'Send-VeeamBackupStatus.ps1') -Destination $scriptPath -Force Copy-Item -Path (Join-Path $PSScriptRoot 'Send-VeeamBackupStatus.ps1') -Destination $scriptPath -Force
Unblock-File -Path $scriptPath Unblock-File -Path $scriptPath
$action = New-ScheduledTaskAction -Execute 'powershell.exe' ` $action = New-ScheduledTaskAction -Execute 'pwsh.exe' `
-Argument "-NoProfile -NonInteractive -ExecutionPolicy Bypass -File `"$scriptPath`"" -Argument "-NoProfile -NonInteractive -ExecutionPolicy Bypass -File `"$scriptPath`""
$trigger = New-ScheduledTaskTrigger -Once -At (Get-Date).AddMinutes(1) ` $trigger = New-ScheduledTaskTrigger -Once -At (Get-Date).AddMinutes(1) `
-RepetitionInterval (New-TimeSpan -Minutes $IntervalMinutes) -RepetitionInterval (New-TimeSpan -Minutes $IntervalMinutes)