Powershell注意隐藏文件


支持PS3.0及以后版本。
当你使用 Get-ChildItem 检索文件,默认是不显示隐藏文件的。
要包含隐藏文件,请使用 –Force 参数。

PS> Get-ChildItem -Path $home -Force

如果只需要显示隐藏文件,可以使用参数-Hidden ,但它只支持PS3.0

PS> Get-ChildItem -Path $home -Hidden


    Directory: C:\Users\Tobias


Mode                LastWriteTime     Length Name                                                                
----                -------------     ------ ----                                                                
d--h-        08.01.2012     10:38            AppData                                                             
d--hs        08.01.2012     10:38            Application Data                                                    
d--hs        08.01.2012     10:38            Cookies                                                             
d--hs        08.01.2012     10:38            Local Settings                                                      
d--hs        08.01.2012     10:38            My Documents                                                        
d--hs        08.01.2012     10:38            NetHood                                                             
(...)
 

原文地址:Dealing with Hidden Files

本文链接: https://www.pstips.net/dealing-with-hidden-files.html
请尊重原作者和编辑的辛勤劳动,欢迎转载,并注明出处!

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注