PowerShell: Skriptide käivitamine Task Scheduleriga: Difference between revisions
Created page with 'lolz' |
No edit summary |
||
Line 1: | Line 1: | ||
$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" |
Revision as of 18:51, 22 April 2012
$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"