Powershell cuts off Task Name at 12 characters

Suppose you run this:
Get-ClusteredScheduledTask

and get this as a result:

TaskName         TaskType                         
--------         --------                         
TestClusterWide  ClusterWide                      
TestResourceS... ResourceSpecific   

What a pain. So how do you see the value of the second TaskName above.
One idea would be to use names under 12 characters. If you must or do use longer names, here’s one solution:

cls
Get-ClusteredScheduledTask
Write "=================="
Write "Expanded:"
foreach ($item in Get-ClusteredScheduledTask )
{
   Write-Host "TaskName=$($item.TaskName) TaskType=$($item.TaskType)"
}


TaskName         TaskType                         
--------         --------                         
TestClusterWide  ClusterWide                      
TestResourceS... ResourceSpecific                 
==================
Expanded:
TaskName=TestClusterWide TaskType=ClusterWide
TaskName=TestResourceSpecific TaskType=ResourceSpecific

Uncategorized  

Leave a Reply