Test in PowerShell code if a folder is a junction point?

前端 未结 6 698
梦谈多话
梦谈多话 2021-01-13 00:30

How can I test in PowerShell code if a folder is a junction point?

6条回答
  •  爱一瞬间的悲伤
    2021-01-13 01:26

    If you have the PowerShell Community Extensions which I would recommend if you are working with junctions you can do the following to determine if a folder is a junction or not:

    Import-Module pscx
    if ((Get-Item *test_folder*).ReparsePoint){
        Write-Host "YES"
    }
    

提交回复
热议问题