Check if a file exists or not in Windows PowerShell?

后端 未结 7 1558
自闭症患者
自闭症患者 2020-12-03 02:38

I have this script which compares files in two areas of the disk and copies the latest file over the one with the older modified date.

$filestowatch=get-con         


        
7条回答
  •  独厮守ぢ
    2020-12-03 02:45

    Test-Path may give odd answer. E.g. "Test-Path c:\temp\ -PathType leaf" gives false, but "Test-Path c:\temp* -PathType leaf" gives true. Sad :(

提交回复
热议问题