mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Remove accidental newlines
This commit is contained in:
parent
e3c6dbf14e
commit
dae8cfe0a9
1 changed files with 3 additions and 6 deletions
|
@ -168,23 +168,20 @@ try {
|
||||||
|
|
||||||
if ($state -eq "present" -and $exists -eq $false){
|
if ($state -eq "present" -and $exists -eq $false){
|
||||||
$action = New-ScheduledTaskAction -Execute $execute
|
$action = New-ScheduledTaskAction -Execute $execute
|
||||||
Register-ScheduledTask -Action $action -Trigger $trigger -TaskName $name -Description $
|
Register-ScheduledTask -Action $action -Trigger $trigger -TaskName $name -Description $description -TaskPath $path -Settings $settings
|
||||||
description -TaskPath $path -Settings $settings
|
|
||||||
$task = Get-ScheduledTask -TaskName $name
|
$task = Get-ScheduledTask -TaskName $name
|
||||||
Set-Attr $result "msg" "Added new task $name"
|
Set-Attr $result "msg" "Added new task $name"
|
||||||
$result.changed = $true
|
$result.changed = $true
|
||||||
}
|
}
|
||||||
elseif($state -eq "present" -and $exists -eq $true) {
|
elseif($state -eq "present" -and $exists -eq $true) {
|
||||||
if ($task.Description -eq $description -and $task.TaskName -eq $name -and $task.TaskPat
|
if ($task.Description -eq $description -and $task.TaskName -eq $name -and $task.TaskPath -eq $path -and $task.Actions.Execute -eq $execute -and $taskState -eq $enabled) {
|
||||||
h -eq $path -and $task.Actions.Execute -eq $execute -and $taskState -eq $enabled) {
|
|
||||||
#No change in the task yet
|
#No change in the task yet
|
||||||
Set-Attr $result "msg" "No change in task $name"
|
Set-Attr $result "msg" "No change in task $name"
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Unregister-ScheduledTask -TaskName $name -Confirm:$false
|
Unregister-ScheduledTask -TaskName $name -Confirm:$false
|
||||||
$action = New-ScheduledTaskAction -Execute $execute
|
$action = New-ScheduledTaskAction -Execute $execute
|
||||||
Register-ScheduledTask -Action $action -Trigger $trigger -TaskName $name -Descripti
|
Register-ScheduledTask -Action $action -Trigger $trigger -TaskName $name -Description $description -TaskPath $path -Settings $settings
|
||||||
on $description -TaskPath $path -Settings $settings
|
|
||||||
$task = Get-ScheduledTask -TaskName $name
|
$task = Get-ScheduledTask -TaskName $name
|
||||||
Set-Attr $result "msg" "Updated task $name"
|
Set-Attr $result "msg" "Updated task $name"
|
||||||
$result.changed = $true
|
$result.changed = $true
|
||||||
|
|
Loading…
Reference in a new issue