Chirag Nagrekar has Published 465 Articles

How to get only hidden files and folders in PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 23-Jan-2020 07:38:59

764 Views

To display only hidden files and folders –hidden parameter is used while using Get-ChildItem.CommandGet-ChildItem D:\Temp\ -HiddenOutputPS C:\WINDOWS\system32> Get-ChildItem D:\Temp\ -Hidden     Directory: D:\Temp Mode                LastWriteTime         Length Name ----                -------------     ... Read More

How to use Depth pararmeter in Get-ChildItem PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 23-Jan-2020 07:38:08

2K+ Views

When –Depth parameter is used along with Get-ChildItem, it controls the recursion of displaying the subfolders and their contents. For example, if –Depth parameter is set to 1 then it will display only the content of the parent folder and immediate subfolders but not the subfolders of the subfolders.CommandWhen you ... Read More

How to control recursion in Get-ChildItem in PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 23-Jan-2020 07:37:03

1K+ Views

When –Depth parameter is used along with Get-ChildItem, it controls the recursion of displaying the subfolders and their contents. For example, if –Depth parameter is set to 1 then it will display only the content of the parent folder and immediate subfolders but not the subfolders of the subfolders.CommandWhen you ... Read More

How to use the -recursive parameter in Get-ChildItem using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 23-Jan-2020 07:33:19

849 Views

To display the contents of the subfolders including files and folders, -Recurse parameter is used.CommandGet-ChildItem -Path D:\Temp -Recurse-Recurse parameter will not display the hidden files and folders.OutputDirectory: D:\Temp Mode                LastWriteTime         Length Name ----             ... Read More

How to list the subfolder contents using Get-ChildItem using PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 23-Jan-2020 07:30:49

5K+ Views

To display the contents of the subfolders including files and folders, -Recurse parameter is used.CommandGet-ChildItem -Path D:\Temp -Recurse-Recurse parameter will not display the hidden files and folders.OutputDirectory: D:\Temp Mode                LastWriteTime         Length Name ----             ... Read More

Which methods are supported by Get-ChildItem in PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 22-Jan-2020 12:44:39

305 Views

There are methods or functions which are useful for directories and file operations.Methods for the directory.TypeName: System.IO.DirectoryInfo Name                      MemberType ----                      ---------- Create                 ... Read More

How to list the directory content in PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 22-Jan-2020 12:42:10

29K+ Views

To display the directory content, Get-ChildItem cmdlet is used. You need to provide the path of the directory or if you are in the same directory, you need to use only Get-ChildItem directly. In the below example, we need to display the contents of the D:\temp directory.When Get-ChildItem command is ... Read More

How to retrieve specific file(s) information using Get-ChildItem in PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 22-Jan-2020 12:40:58

2K+ Views

When the item (file) path is provided to the Get-ChildItem cmdlet, it extracts the file information like Name, LastWriteTime, Size, etc.ExampleGet-ChildItem -Path D:\Temp\style.cssOutputDirectory: D:\Temp Mode                LastWriteTime         Length Name ----                -------------     ... Read More

What are the parameters supported by Get-ChildItem in PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 22-Jan-2020 12:39:08

214 Views

Below parameters are supported by Get-ChildItems. Get-ChildItem[[-Path] ] [[-Filter] ] [-Include ] [-Exclude ] [-Recurse] [-Depth ] [-Force] [-Name] [-Attributes ] [-FollowSymlink] [-Directory] [-File] [-Hidden] [-ReadOnly] [-System] []

Which properties are supported by the Get-ChildItem in PowerShell?

Chirag Nagrekar

Chirag Nagrekar

Updated on 22-Jan-2020 12:37:46

3K+ Views

When you pipeline the parameter Get-Member (alias gm) and filter out properties then there will be two different properties that will be displayed. One is for the File and another is for the Folders.Get-ChildItem propertiesCommandGet-ChildItem | gm | where{$_.Membertype -eq "Property"}Output** Properties of Directory TypeName: System.IO.DirectoryInfo Name       ... Read More

Advertisements