0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Powershell > サブフォルダのsystem.hwdefファイルを探して最終更新日時を表示

Last updated at Posted at 2016-01-12
動作確認
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

ファイル探索の方法がまだまだ身についていない。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?