February 2019
Intermediate to advanced
626 pages
15h 51m
English
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:\Windows\System32\cmd.exe # A leaf item Get-Item Cert:\LocalMachine\Root #A container item
The Get-ChildItem command, which has dir and ls aliases, is used to list the children of the current item.
Neither Get-ChildItem nor Get-Item will show hidden files and folders by default. The following error will be returned for a hidden item:
PS> Get-Item $env:USERPROFILE\AppDataGet-Item : Could not find item C:\Users\Someone\AppData.At line:1 char:1+ Get-Item $env:USERPROFILE\AppData+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (C:\Users\Someone ...
Read now
Unlock full access