PowerShell: Skriptide käivitamine Task Scheduleriga
$location=Split-Path -parent $MyInvocation.MyCommand.Definition Get-WmiObject win32_logicaldisk| select-object volumename, deviceid, {$_.freespace/1gb} |format-table -autosize|out-file $location\currentspace.txt new-item $location\disklog -type directory -force|out-null new-item $location\disklog\buffer.txt -type file|out-null copy-item $location\disklog\freespace.txt $location\disklog\buffer.txt -ea 0 $aeg=get-date echo $aeg|out-file $location\disklog\freespace.txt get-content $location\currentspace.txt|out-file $location\disklog\freespace.txt -append get-content $location\disklog\buffer.txt|out-file $location\disklog\freespace.txt -append remove-item $location\disklog\buffer.txt echo "Kõikide ketaste vaba ruum on kirjutatud faili $location\disklog\freespace.txt"