19.3. Finding Hidden Files

The get-childitem cmdlet allows you to force information about hidden files or folders to be displayed. To display hidden files or folders, use the Force parameter with the get-childitem cmdlet.

In this example, you display files and folders whose name begins with the letter r. The current location is C:\ on a Windows XP SP2 machine. To display those files and folders use this command:

get-childitem -Path [rs]*

When you add the Force parameter:

get-childitem -Path [rs]* -Force

the hidden folders RECYCLER and System Volume Information are displayed in the results. Figure 19-18 shows the results of executing the two preceding commands. Notice in Figure 19-18 that the mode for RECYCLER and System Volume Information contains an h that indicates that the folder is hidden.

Figure 19.18. Figure 19-18

Get Professional Windows® PowerShell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.