One trick to using schtasks.exe with PowerShell is to use the /fo csv option which - surprise, surprise - forces the command to output in CSV format. Luckily PowerShell has the ConvertFrom-Csv cmdlet which works fairly seamlessly.
Below is an example of retrieving scheduled tasks from a computer named "SERV01" using Invoke-Command. The command to remotely execute is stored in the $ScriptBlock variable.
$ScriptBlock = { schtasks.exe /query /s localhost /V /FO CSV | ConvertFrom-Csv } $ComputerList = Get-ADComputer -Filter "Name -like 'SERV01'" foreach ($Computer in $ComputerList) { Invoke-Command -ComputerName $Computer.Name -ScriptBlock $ScriptBlock }