File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -23,14 +23,18 @@ Remove-BoxstarterTask
2323 if ($Credential.GetNetworkCredential ().Password.length -gt 0 ){
2424 schtasks / CREATE / TN ' Temp Boxstarter Task' / SC WEEKLY / RL HIGHEST `
2525 / RU " $ ( $Credential.UserName ) " / IT / RP $Credential.GetNetworkCredential ().Password `
26- / TR " powershell -noprofile -ExecutionPolicy Bypass -File $env: temp \BoxstarterTask.ps1" / F |
27- Out-Null
26+ / TR " powershell -noprofile -ExecutionPolicy Bypass -File $env: temp \BoxstarterTask.ps1" / F
2827
2928 # Give task a normal priority
3029 $taskFile = Join-Path $env: TEMP RemotingTask.txt
3130 Remove-Item $taskFile - Force - ErrorAction SilentlyContinue
3231 [xml ]$xml = schtasks / QUERY / TN ' Temp Boxstarter Task' / XML
32+ if ($xml.Task.Settings.Priority -eq $null ) {
33+ $priority = $xml.CreateElement (" Priority" , " http://schemas.microsoft.com/windows/2004/02/mit/task" )
34+ $xml.Task.Settings.AppendChild ($priority )
35+ }
3336 $xml.Task.Settings.Priority = " 4"
37+ Write-BoxstarterMessage " savin"
3438 $xml.Save ($taskFile )
3539 schtasks / CREATE / TN ' Boxstarter Task' / RU " $ ( $Credential.UserName ) " / IT / RP $Credential.GetNetworkCredential ().Password / XML " $taskFile " / F | Out-Null
3640 schtasks / DELETE / TN ' Temp Boxstarter Task' / F | Out-Null
You can’t perform that action at this time.
0 commit comments