Learn about Windows PowerShell
Summary: Many times Windows PowerShell cmdlets display additional information when using the Force switch.
How can I display hidden and system files when using Windows PowerShell?
Use the Get-Item or Get-ChildItem cmdlet and use the Force switch—this works with other cmdlets as well.
Get-ChildItem -force
Hi Ed,
and I still wonder why ... why not add a switch -hidden ?
Or add an "-attribute hidden" parameter ?
There is a readonly, system, archive etc. attribute but still we have to use "-force" if we want to reveal hidden files or directories ???
And that's ... why I still wonder why ... :-)
Klaus.
Thought you were channeling Obi-Wan there for a moment...
@Klaus
I think we can use the property "Mode" to get the specifiy files or directories you want, right?
Like hiden files
ls -force | ?{$_.mode -match "h"}
@Klaus Schulte one reason is because -Force is a common switch that is honored by hundreds of cmdlets. To stay consistent we use standard parameters.
@Martin9700 it is how I remember ... "Use the Force ....." Then I don't forget it :-0
@Larry Song CN good point.