●size.txtの内容
colMode colkey colIsPersonal colcomment
R C:\PStest FALSE 計算
$myarr = Get-Content $file_path
#$myarr
foreach($i in $myarr){
$row = $i.Replace(" ",",")
$rowCol = $row.Split(",")
#$rowCol[1]
if($rowCol[1] -eq "colkey"){
write-host $rowCol[1] -foregroundcolor "green"
}
else
{
#$rowCol[1] = C:\PStest
$sizePro=Get-ChildItem $rowCol[1] -Recurse | Measure-Object -property length -sum
write-host ($sizePro.Sum / 1024) "MB"
$sizePro
}
colMode colkey colIsPersonal colcomment
R C:\PStest FALSE 計算
●*.ps1
$myarr = Get-Content $file_path
#$myarr
foreach($i in $myarr){
$row = $i.Replace(" ",",")
$rowCol = $row.Split(",")
#$rowCol[1]
if($rowCol[1] -eq "colkey"){
write-host $rowCol[1] -foregroundcolor "green"
}
else
{
#$rowCol[1] = C:\PStest
$sizePro=Get-ChildItem $rowCol[1] -Recurse | Measure-Object -property length -sum
write-host ($sizePro.Sum / 1024) "MB"
$sizePro
}
}