Repository navigation
Export-ScheduledTask : example 2 is inconsistent with actual behaviour #4112
Copy link
Copy link
Open
Labels
issue-doc-bugSomething is out of date, unclear, confusing, or broken in the article. Blocks customer success.Something is out of date, unclear, confusing, or broken in the article. Blocks customer success.needs-triageWaiting - Needs triageWaiting - Needs triage
Description
Prerequisites
- Existing Issue: Search the existing issues for this repository. If there is an issue that fits your needs do not file a new one. Subscribe, react, or comment on that issue instead.
- Descriptive Title: Write the title for this issue as a short synopsis. If possible, provide context. For example, "Typo in
Get-Foocmdlet" instead of "Typo." - Verify Version: If there is a mismatch between documentation and the behavior on your system, ensure that the version you are using is the same as the documentation. Check this box if they match or the issue you are reporting is not version specific.
Links
Summary
Example 2 shows:
Get-ScheduledTask -TaskPath "\UpdateTasks\" | Export-ScheduledTaskThis implies that the cmdlet supports multiple pipeline input objects.
However, in practice, piping multiple tasks results in:
HRESULT 0x80070057 (The parameter is incorrect)
Details
Get-ScheduledTask -TaskPath '\Microsoft\Windows\Time Synchronization\' | Export-ScheduledTask
....
Export-ScheduledTask : El parámetro no es correcto.
En línea: 1 Carácter: 74
+ ... ndows\Time Synchronization\' | Export-ScheduledTask -ErrorVariable kk
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (PS_ScheduledTask:Root/Microsoft/...S_ScheduledTask) [Export-ScheduledT
ask], CimException
+ FullyQualifiedErrorId : HRESULT 0x80070057,Export-ScheduledTaskSeems it is not related to the collection:
Get-ScheduledTask -TaskPath '\Microsoft\Windows\Time Synchronization\' -TaskName ForceSynchronizeTime | Export-ScheduledTask
Export-ScheduledTask : El parámetro no es correcto.
En línea: 1 Carácter: 105
+ ... nchronization\' -TaskName ForceSynchronizeTime | Export-ScheduledTask
+ ~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (PS_ScheduledTask:Root/Microsoft/...S_ScheduledTask) [Export-ScheduledTask], CimException
+ FullyQualifiedErrorId : HRESULT 0x80070057,Export-ScheduledTaskSuggested Fix
Support -OutputPath to save scheduled task in a file
Document about how to use Out-File and/or the encoding necesary
Change the example to use
Get-ScheduledTask -TaskPath '\Microsoft\Windows\Time Synchronization\' | Foreach-Object {
Export-ScheduledTask -TaskPath $_.taskpath -TaskName $_.taskname -ov "+tasks"
} | Out-Null
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
issue-doc-bugSomething is out of date, unclear, confusing, or broken in the article. Blocks customer success.Something is out of date, unclear, confusing, or broken in the article. Blocks customer success.needs-triageWaiting - Needs triageWaiting - Needs triage
Activity