Skip to content

Commit

Permalink
[dsccommunity#248] Get-ScheduledTask calls fix to avoid name clashes …
Browse files Browse the repository at this point in the history
…with Carbon
  • Loading branch information
bozho committed Aug 27, 2019
1 parent be97aa6 commit b640d37
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
- Changes to ScheduledTask:
- Delay property not handled properly on AtLogon and AtStartup trigger - Fixes
[Issue #230](https://github.com/PowerShell/ComputerManagementDsc/issues/230)
- Changed `Get-ScheduledTask` calls to `ScheduledTasks\Get-ScheduledTask` to
avoid name clash with `Carbon` module. Fixes [Issue #248](https://github.com/PowerShell/ComputerManagementDsc/issues/248)
- PendingReboot:
- Migrated xPendingReboot from [xPendingReboot](https://github.com/PowerShell/xPendingReboot)
and renamed to PendingReboot.
Expand Down
6 changes: 3 additions & 3 deletions DSCResources/MSFT_ScheduledTask/MSFT_ScheduledTask.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ function Set-TargetResource
Write-Verbose -Message ($script:localizedData.RetrieveScheduledTaskMessage -f $TaskName, $TaskPath)
$tempScheduledTask = New-ScheduledTask @scheduledTaskArguments -ErrorAction Stop

$scheduledTask = Get-ScheduledTask `
$scheduledTask = ScheduledTasks\Get-ScheduledTask `
-TaskName $currentValues.TaskName `
-TaskPath $currentValues.TaskPath `
-ErrorAction Stop
Expand Down Expand Up @@ -1610,7 +1610,7 @@ function Disable-ScheduledTask
$TaskPath = '\'
)

$existingTask = Get-ScheduledTask @PSBoundParameters
$existingTask = ScheduledTasks\Get-ScheduledTask @PSBoundParameters
$existingTask.Settings.Enabled = $false
$null = $existingTask | Register-ScheduledTask @PSBoundParameters -Force
}
Expand Down Expand Up @@ -1683,7 +1683,7 @@ function Get-CurrentResource

Write-Verbose -Message ($script:localizedData.GettingCurrentTaskValuesMessage -f $TaskName, $TaskPath)

$task = Get-ScheduledTask -TaskName $TaskName -TaskPath $TaskPath -ErrorAction SilentlyContinue
$task = ScheduledTasks\Get-ScheduledTask -TaskName $TaskName -TaskPath $TaskPath -ErrorAction SilentlyContinue

if ($null -eq $task)
{
Expand Down

0 comments on commit b640d37

Please sign in to comment.