LoginSignup
4
3

More than 5 years have passed since last update.

ハードリンクの一覧を出力する

Posted at

ハードリンクされているファイルをコンソールに出力します。

fsutil hardlink list コマンドを実行して、結果が複数行返ってくればハードリンクされてるという判断です。
かなりの力技ですがw

Get-ChildItem C:\ -Recurse | ?{ !$_.PSIsContainer } | 
%{
    $res=fsutil hardlink list $_.FullName;
    if (($LASTEXITCODE -eq 0 ) -and ($res -is [System.Object[]])) {
    Write-Host $_.FullName;
    } 
}
4
3
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
4
3