Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New-ScheduledTask Example 2 Incorrect #3899

Open
3 tasks done
PaulDash opened this issue Nov 8, 2024 · 1 comment
Open
3 tasks done

New-ScheduledTask Example 2 Incorrect #3899

PaulDash opened this issue Nov 8, 2024 · 1 comment
Labels
issue-doc-bug Something is out of date, unclear, confusing, or broken in the article. Blocks customer success. needs-triage Waiting - Needs triage

Comments

@PaulDash
Copy link

PaulDash commented Nov 8, 2024

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-Foo cmdlet" 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

https://learn.microsoft.com/en-us/powershell/module/scheduledtasks/new-scheduledtask?view=winserver2012-ps#examples

Summary

Example 2 states that two scripts will be run. The scripts will open in an editor.

Details

The example description states that:
This example creates and registers a scheduled task that runs two PowerShell scripts daily at 09:15 AM.

Meanwhile, using New-ScheduledTaskAction -Execute 'foo.ps1' will only launch the editor associated with .ps1 files on a given system and will not execute the script.

Suggested Fix

The example should show how to execute pwsh.exe (or powershell.exe for older versions) along with arguments that point to executing the scripts. The example can then be expanded to show how to save the output generated by those scripts.

@PaulDash PaulDash added issue-doc-bug Something is out of date, unclear, confusing, or broken in the article. Blocks customer success. needs-triage Waiting - Needs triage labels Nov 8, 2024
@sdwheeler
Copy link
Contributor

sdwheeler commented Nov 8, 2024

This issue is in the wrong repository. The MicrosoftDocs/PowerShell-Docs repository contains the content for the base PowerShell product. The documentation for the Windows management modules is MicrosoftDocs/windows-powershell-docs.

I have transferred this issue to the correct repository.

@sdwheeler sdwheeler transferred this issue from MicrosoftDocs/PowerShell-Docs Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue-doc-bug Something is out of date, unclear, confusing, or broken in the article. Blocks customer success. needs-triage Waiting - Needs triage
Projects
None yet
Development

No branches or pull requests

2 participants