Entrinsec.Powershell.Scheduling (1.15.78)

Published 2026-02-26 16:52:49 +00:00 by Entrinsec in Entrinsec/Entrinsec

Installation

dotnet nuget add source --name Entrinsec 
dotnet add package --source Entrinsec --version 1.15.78 Entrinsec.Powershell.Scheduling

About this package

Functions for scheduling launching of apps, scripts and other similar activities.

Entrinsec.Powershell.Scheduling

PowerShell module for managing Windows Scheduled Tasks with consistent logging and error handling.

Features

  • Remove-ScheduledTaskIfExists: Safely remove scheduled tasks with automatic fallback to schtasks.exe if ScheduledTasks module is unavailable
  • New-EntrinsecScheduledTask: Create scheduled tasks with common trigger types (Once, Daily, Hourly, AtLogon, AtStartup)
  • Get-EntrinsecScheduledTasks: List scheduled tasks with optional filtering
  • Copy-EntrinsecScheduledTask: Duplicate existing scheduled tasks with optional user/privilege changes

Compatibility

This module automatically detects the available PowerShell environment:

  • PowerShell 5.1+ / PowerShell 7+: Uses native ScheduledTasks cmdlets
  • Older PowerShell or missing ScheduledTasks module: Falls back to schtasks.exe command-line utility for Remove operations

Note: When using -User INTERACTIVE, tasks are created with LogonType Interactive and will run as the current logged-on user.

Installation

Using NuGet

nuget install Entrinsec.Powershell.SCHEDULING

Direct Import

Import-Module 'C:\ADO\COMMON\Modules\Entrinsec\BaGetter\Entrinsec.Powershell.Scheduling' -Force

Requirements

  • PowerShell 5.1 or higher (recommended for full functionality)
  • Administrator privileges for task creation/deletion
  • Entrinsec.Powershell.Common module (for logging functions)

Usage Examples

Remove a Scheduled Task

Remove-ScheduledTaskIfExists -TaskName "MyTask"

Create a Scheduled Task (Hourly)

New-EntrinsecScheduledTask -TaskName "MyHourlyTask" `
    -ExecutePath "C:\Windows\System32\wscript.exe" `
    -Arguments "//B C:\Scripts\MyScript.vbs" `
    -TriggerType Hourly `
    -User INTERACTIVE `
    -RunWithHighestPrivileges `
    -Force

Create a Scheduled Task (At Logon)

New-EntrinsecScheduledTask -TaskName "OpenAdminCMD" `
    -ExecutePath "C:\Windows\System32\cmd.exe" `
    -TriggerType AtLogon `
    -User INTERACTIVE `
    -RunWithHighestPrivileges `
    -Force

List Scheduled Tasks

Get-EntrinsecScheduledTasks -NameLike "Choc*"

More information available at entrinsec.com

Release notes are contained in the package in the RELEASE_NOTES.md file.

Details
NuGet
2026-02-26 16:52:49 +00:00
31
Entrinsec
176 KiB
Assets (2)
Versions (1) View all
1.15.78 2026-02-26