Update scheduled task to use Powershell 7
Todo: add logic to check for and install Powershell 7
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user