Hi,
In Old days when we need to saw the hidden files we used Dir /a command to view them. If you don't know let me show you the example
first we run a simple Dir *. command to show the us the list of folders are it is showing only 11 Directories.
Secondly we run the Dir *. /a command and it showing us 18 Directories , which means we have 7 hidden directories.
how we can access the same information using PowerShell? it’s very easy just use the Get-ChildItem Cmdlet.
first Run Get-ChildItem only and we can see that it is showing only few directories.
OK Now run the Get-ChildItem with –Force Switch.
and you can see now we have more directories listed here. You can notice in the front of some directories the Mode is “h” {green arrow} ,which means the attribute for these directories is set to hidden.
or the other way to see the the Hidden files are folder in current folder is to run this command line.
Get-ChildItem -Force | where { $_.Attributes -match "Hidden"}
this will show you only “Hidden” files and folders.
Thanks for reading.,..
Aman Dhally
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.