The Get-Item command is used to get an object represented by a path:
Get-Item # The root container Get-Item . # The current container Get-Item .. # The parent container Get-Item C:WindowsSystem32cmd.exe # A leaf item Get-Item Cert:LocalMachineRoot#A container item
The Get-ChildItem command, which has the aliases of dir and ls, is used to list the children of the current item.
Both Get-ChildItem and Get-Item will not show hidden files and folders by default. The following error will be returned for a hidden item:
PS> Get-Item $env:USERPROFILEAppData
Get-Item : Could not find item C:UsersSomeoneAppData.
At line:1 char:1
+ Get-Item $env:USERPROFILEAppData
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:UsersSomeone AppData:String) [Get-Item], IOException
+ FullyQualifiedErrorId : ItemNotFound,Microsoft.PowerShell.Commands.GetItemCommand
The Force parameter may be added to access hidden items:
PS> Get-Item $env:USERPROFILEAppData -Force
Directory: C:UsersSomeone
Mode LastWriteTime Length Name
---- ------------- ------ ----
d--h-- 23/09/2016 18:22 AppData