AgentSkillsCN

outlook-tasks

通过 PowerShell 管理 Outlook 任务:列出、创建、更新、完成、分配任务,并为任务设置优先级、截止日期、提醒及状态追踪。脚本会在必要时自动启动 Outlook。

SKILL.md
--- frontmatter
name: outlook-tasks
description: "Manage Outlook tasks via PowerShell: list, create, update, complete, assign, and delete tasks with priorities, due dates, reminders, and status tracking. Scripts auto-start Outlook when needed."

Outlook Tasks

Manage Microsoft Outlook tasks using PowerShell COM objects.

Prerequisites

  • Microsoft Outlook installed (scripts auto-start Outlook if it is not running)
  • PowerShell 5.1+ (included in Windows 10/11)
  • Task assignment requires Exchange/Office 365

List Tasks

outlook-tasks-list.ps1

Browse tasks with optional status filtering. Returns EntryIDs for use with action scripts.

Required Parameters: None (lists active tasks by default)

ParameterTypeDefaultDescription
-Limitint20Maximum tasks to display
-IncludeCompletedswitchfalseInclude completed tasks in the list
-StatusstringAllFilter by status: All, NotStarted, InProgress, Completed, Waiting, Deferred
powershell
# List active tasks
& "./scripts/outlook-tasks-list.ps1" -Limit 20

# Include completed tasks
& "./scripts/outlook-tasks-list.ps1" -IncludeCompleted

# Filter by status
& "./scripts/outlook-tasks-list.ps1" -Status InProgress

Create Task

outlook-tasks-create.ps1

Create a new task with optional due date, priority, and reminder.

Required Parameters: -Subject

ParameterTypeDefaultDescription
-SubjectstringRequiredTask subject/title
-DueDatedatetimeDue date (e.g., "2026-02-15")
-StartDatedatetimeStart date
-PrioritystringNormalPriority: Low, Normal, High
-BodystringTask description/notes
-ReminderdatetimeReminder date and time (e.g., "2026-02-10 09:00")
powershell
# Create a task with due date
& "./scripts/outlook-tasks-create.ps1" -Subject "Review proposal" -DueDate "2026-02-15" -Priority High

# Create task with reminder
& "./scripts/outlook-tasks-create.ps1" -Subject "Call client" -Reminder "2026-02-10 09:00"

# Create task with body text
& "./scripts/outlook-tasks-create.ps1" -Subject "Prepare slides" -Body "Include Q4 data and projections"

Update Task

outlook-tasks-update.ps1

Edit an existing task's fields. Uses EntryID (preferred) or Index as targeting method.

Required Parameters: -EntryID or -Index, plus at least one field to update

ParameterTypeDefaultDescription
-EntryIDstringTask's unique EntryID (preferred, from list)
-Indexint0Task position number (fallback)
-SubjectstringNew subject/title
-DueDatedatetimeNew due date
-StartDatedatetimeNew start date
-StatusstringNew status: NotStarted, InProgress, Completed, Waiting, Deferred
-PrioritystringNew priority: Low, Normal, High
-BodystringNew description/notes
-PercentCompleteint-1Progress percentage (0-100, auto-updates status)
-ReminderdatetimeSet reminder date and time
-ClearReminderswitchfalseRemove existing reminder
-IncludeCompletedswitchfalseAllow targeting completed tasks by Index
powershell
# Update status and progress by EntryID
& "./scripts/outlook-tasks-update.ps1" -EntryID "00000000..." -Status InProgress -PercentComplete 50

# Change due date and priority by index
& "./scripts/outlook-tasks-update.ps1" -Index 1 -DueDate "2026-02-20" -Priority High

# Set a reminder
& "./scripts/outlook-tasks-update.ps1" -EntryID "00000000..." -Reminder "2026-02-10 09:00"

# Clear a reminder
& "./scripts/outlook-tasks-update.ps1" -EntryID "00000000..." -ClearReminder

Complete Task

outlook-tasks-complete.ps1

Mark a task as completed. Supports targeting by EntryID (preferred), Index, or Subject.

Required Parameters: One of -EntryID, -Index, or -Subject

ParameterTypeDefaultDescription
-EntryIDstringTask's unique EntryID (preferred)
-Indexint0Task position number (fallback, non-completed tasks only)
-SubjectstringExact subject match (fallback)
powershell
# Complete by EntryID (preferred)
& "./scripts/outlook-tasks-complete.ps1" -EntryID "00000000..."

# Complete by index
& "./scripts/outlook-tasks-complete.ps1" -Index 1

# Complete by subject
& "./scripts/outlook-tasks-complete.ps1" -Subject "Review proposal"

Assign Task

outlook-tasks-assign.ps1

Delegate a task to another person via Exchange/Microsoft 365. Sends a task request email.

Required Parameters: (-EntryID or -Index) and -AssignTo

ParameterTypeDefaultDescription
-EntryIDstringTask's unique EntryID (preferred)
-Indexint0Task position number (fallback)
-AssignTostringRequiredRecipient email address
-KeepCopyswitchfalseKeep a copy of the task in your list
-IncludeCompletedswitchfalseAllow targeting completed tasks by Index
powershell
# Assign by EntryID
& "./scripts/outlook-tasks-assign.ps1" -EntryID "00000000..." -AssignTo "colleague@example.com"

# Assign by index and keep a copy
& "./scripts/outlook-tasks-assign.ps1" -Index 1 -AssignTo "colleague@example.com" -KeepCopy

Delete Task

outlook-tasks-delete.ps1

Delete a task from Outlook. Supports targeting by EntryID (preferred), Index, or Subject.

Required Parameters: One of -EntryID, -Index, or -Subject

ParameterTypeDefaultDescription
-EntryIDstringTask's unique EntryID (preferred)
-Indexint0Task position number (fallback, non-completed tasks only)
-SubjectstringExact subject match (fallback)
powershell
# Delete by EntryID (preferred)
& "./scripts/outlook-tasks-delete.ps1" -EntryID "00000000..."

# Delete by index
& "./scripts/outlook-tasks-delete.ps1" -Index 1

# Delete by subject
& "./scripts/outlook-tasks-delete.ps1" -Subject "Old task"

Reference: Task Status Values

ValueStatus
0Not Started
1In Progress
2Completed
3Waiting
4Deferred

Reference: Priority Values

ValuePriority
0Low
1Normal
2High