You could replace it all with:
function Get-ScheduledTask {
end {
SCHTASKS.EXE /QUERY /FO CSV | ConvertFrom-Csv
}
}
function Get-ScheduledTask {
end {
SCHTASKS.EXE /QUERY /FO CSV | ConvertFrom-Csv
}
}