動作確認
Windows 8.1 pro (64bit)
指定の親フォルダの下層にあるsystem.hwdefファイルを探して、その最終更新日を表示するスクリプト
探索フォルダはdir_config.txtに指定する。
dir_config.txt
C:\ZyboDev\zybo_160112_baseDesign
findHwdef.ps1
function readDirInfo($scriptDir)
{
$procDir = ( Get-Content $scriptDir\dir_config.txt )
<#
return "TEST"
# >
return $procDir
}
function findHwdef($procDir)
{
$target = ( Get-ChildItem $procDir -Recurse "system.hwdef" )
return $target.Fullname
}
$prcDir = readDirInfo(".\\")
echo "process directory=$prcDir"
$hwfile = findHwdef($prcDir)
echo $hwfile
echo (Get-ChildItem $hwfile).LastWriteTime
実行結果
process directory=C:\ZyboDev\zybo_160112_baseDesign
C:\ZyboDev\zybo_160112_baseDesign\hw\zybo_bsd\zybo_bsd.srcs\sources_1\bd\system\hdl\system.hwdef
2016年1月12日 22:09:12
ファイル探索の方法がまだまだ身についていない。