I can create a Scheduled Task in Windows using the Register-ScheduledTask PowerShell cmdlet with a particular path (i.e., using -TaskPath "\SomePath\" and -TaskName "SomeName"). I can delete the Task using the Unregister-ScheduledTask with the same parameters. I can verify the deletion with the Windows "Task Scheduler" GUI. However, the folder ("\SomePath\") does not get deleted. While this makes perfect sense, I cannot find any way to delete this empty folder.
How do I delete an empty Task Scheduler folder using PowerShell?
UPDATE: After more research, I found another way to solve this problem within PowerShell. It involves working with a Schedule.Service object. Here is the code to delete a folder called 'My Task Folder':
$scheduleObject = New-Object -ComObject Schedule.Service
$scheduleObject.connect()
$rootFolder = $scheduleObject.GetFolder("\")
$rootFolder.DeleteFolder("My Task Folder",$null)