Quantcast
Viewing latest article 7
Browse Latest Browse All 8

Commented Issue: Get-ScheduledTasks has a lot of unneccessary script [2]

You could replace it all with:

function Get-ScheduledTask {
end {
SCHTASKS.EXE /QUERY /FO CSV | ConvertFrom-Csv
}
}
Comments: You are right, but the function has been written in this way for two reasons : 1- The NoteProperty "TaskName" and "TaskStatus" depends on OS localization. For example, a French Windows version will return "Nom de la tâche" and "État", and a US version will return "TaskName" and "Status" To be usable in any OS localization, the split is used to retrieve status and taskname column name. 2- To interact with Stop and Start Functions (with the NoteProperty generated)

Viewing latest article 7
Browse Latest Browse All 8

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>