diff --git a/CHANGELOG.md b/CHANGELOG.md index bddb9e06..3f3bb1ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/DSCResources/MSFT_ScheduledTask/MSFT_ScheduledTask.psm1 b/DSCResources/MSFT_ScheduledTask/MSFT_ScheduledTask.psm1 index 6374e1f4..f22de225 100644 --- a/DSCResources/MSFT_ScheduledTask/MSFT_ScheduledTask.psm1 +++ b/DSCResources/MSFT_ScheduledTask/MSFT_ScheduledTask.psm1 @@ -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 @@ -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 } @@ -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) {