Skip to content

Commit 4434e71

Browse files
committed
Revert "Update Get-Item.md (MicrosoftDocs#1942)"
This reverts commit 5119bda.
1 parent 14a3369 commit 4434e71

File tree

1 file changed

+28
-108
lines changed
  • reference/5.1/Microsoft.PowerShell.Management

1 file changed

+28
-108
lines changed

reference/5.1/Microsoft.PowerShell.Management/Get-Item.md

Lines changed: 28 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ Gets the item at the specified location.
1616
## SYNTAX
1717

1818
### Path (Default)
19-
```powershell
19+
```
2020
Get-Item [-Path] <String[]> [-Filter <String>] [-Include <String[]>] [-Exclude <String[]>] [-Force]
2121
[-Credential <PSCredential>] [-UseTransaction] [-Stream <String[]>] [<CommonParameters>]
2222
```
2323

2424
### LiteralPath
25-
```powershell
25+
```
2626
Get-Item -LiteralPath <String[]> [-Filter <String>] [-Include <String[]>] [-Exclude <String[]>] [-Force]
2727
[-Credential <PSCredential>] [-UseTransaction] [-Stream <String[]>] [<CommonParameters>]
2828
```
@@ -37,70 +37,60 @@ This cmdlet is used by Windows PowerShell providers to navigate through differen
3737

3838
### Example 1: Get the current directory
3939
```
40-
PS C:\ps-test> Get-Item .
40+
PS C:\> Get-Item .
41+
4142
42-
Directory: C:\
4343
4444
45+
46+
Directory: C:\
4547
Mode LastWriteTime Length Name
4648
---- ------------- ------ ----
47-
d----- 7/26/2006 10:01 AM ps-test
49+
d---- 7/26/2006 10:01 AM ps-test
4850
```
4951

5052
This command gets the current directory.
5153
The dot (.) represents the item at the current location (not its contents).
5254

5355
### Example 2: Get all the items in the current directory
5456
```
55-
PS C:\ps-test> Get-Item *
57+
PS C:\> Get-Item *
58+
59+
60+
61+
62+
63+
64+
65+
5666
57-
Directory: C:\ps-test
5867
5968
69+
Directory: C:\ps-test
6070
Mode LastWriteTime Length Name
6171
---- ------------- ------ ----
62-
d----- 7/26/2006 9:29 AM Logs
63-
d----- 7/26/2006 9:26 AM Recs
64-
-a---- 7/26/2006 9:28 AM 80 date.csv
65-
-a---- 7/26/2006 10:01 AM 30 filenoext
66-
-a---- 7/26/2006 9:30 AM 11472 process.doc
67-
-a---- 7/14/2006 10:47 AM 30 test.txt
72+
d---- 7/26/2006 9:29 AM Logs
73+
d---- 7/26/2006 9:26 AM Recs
74+
-a--- 7/26/2006 9:28 AM 80 date.csv
75+
-a--- 7/26/2006 10:01 AM 30 filenoext
76+
-a--- 7/26/2006 9:30 AM 11472 process.doc
77+
-a--- 7/14/2006 10:47 AM 30 test.txt
6878
```
6979

7080
This command gets all the items in the current directory.
7181
The wildcard character (*) represents all the contents of the current item.
7282

7383
### Example 3: Get the current directory of a drive
7484
```
75-
PS C:\ps-test> Get-Item C:\
76-
77-
78-
Directory:
79-
80-
81-
Mode LastWriteTime Length Name
82-
---- ------------- ------ ----
83-
d--hs- 12/10/2017 1:16 PM C:\
85+
PS C:\> Get-Item C:\
8486
```
8587

8688
This command gets the current directory of the C: drive.
8789
The object that is retrieved represents only the directory, not its contents.
8890

89-
### Example 4: Get items in the specified drive root
91+
### Example 4: Get items in the specified drive
9092
```
91-
PS C:\ps-test> Get-Item C:\*
92-
93-
94-
Directory: C:\
95-
96-
97-
Mode LastWriteTime Length Name
98-
---- ------------- ------ ----
99-
d----- 3/19/2017 12:33 AM PerfLogs
100-
d-r--- 11/29/2017 2:36 PM Program Files
101-
d-r--- 11/29/2017 2:14 PM Program Files (x86)
102-
d-r--- 7/16/2017 4:03 PM Users
103-
d----- 12/10/2017 1:16 PM Windows
93+
PS C:\> Get-Item C:\*
10494
```
10595

10696
This command gets the items in the C: drive.
@@ -112,8 +102,6 @@ The format is interpreted literally, so *.* would not retrieve directories or fi
112102
### Example 5: Get a property in the specified directory
113103
```
114104
PS C:\> (Get-Item C:\Windows).LastAccessTime
115-
116-
Sunday, December 10, 2017 1:16:45 PM
117105
```
118106

119107
This command gets the LastAccessTime property of the C:\Windows directory.
@@ -122,83 +110,15 @@ To see all of the properties of a directory, type `(Get-Item \<directory-name\>)
122110

123111
### Example 6: Show the contents of a registry key
124112
```
125-
PS C:\Windows> Get-Item "hklm:\Software\Microsoft\Windows NT\*"
126-
127-
128-
Hive: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT
129-
130-
131-
Name Property
132-
---- --------
133-
CurrentVersion SystemRoot : C:\WINDOWS
134-
BuildBranch : rs2_release
135-
BuildGUID : ffffffff-ffff-ffff-ffff-ffffffffffff
136-
BuildLab : 15063.rs2_release.170317-1834
137-
BuildLabEx : 15063.0.amd64fre.rs2_release.170317-1834
138-
CompositionEditionID : Enterprise
139-
CurrentBuild : 15063
140-
CurrentBuildNumber : 15063
141-
CurrentMajorVersionNumber : 10
142-
CurrentMinorVersionNumber : 0
143-
CurrentType : Multiprocessor Free
144-
CurrentVersion : 6.3
145-
EditionID : Enterprise
146-
EditionSubstring :
147-
InstallationType : Client
148-
InstallDate : 1495262485
149-
ProductName : Windows 10 Enterprise
150-
ReleaseId : 1703
151-
SoftwareType : System
152-
UBR : 726
153-
PathName : C:\WINDOWS
154-
DigitalProductId : {164, 0, 0, 0...}
155-
DigitalProductId4 : {248, 4, 0, 0...}
156-
ProductId : 00329-00000-00003-AA840
157-
RegisteredOrganization :
158-
RegisteredOwner :
159-
InstallTime : 131397360853701614
113+
PS C:\> Get-Item hklm:\software\microsoft\powershell\1\shellids\microsoft.powershell\*
160114
```
161115

162-
This command shows the contents of the "Windows NT" registry key.
116+
This command shows the contents of the Microsoft.PowerShell registry key.
163117
You can use this cmdlet with the Windows PowerShell Registry provider to get registry keys and subkeys, but you must use the **Get-ItemProperty** cmdlet to get the registry values and data.
164118

165119
### Example 7: Get items in a directory that have an exclusion
166120
```
167121
PS C:\> Get-Item c:\Windows\*.* -exclude "w*"
168-
169-
170-
Directory: C:\Windows
171-
172-
173-
Mode LastWriteTime Length Name
174-
---- ------------- ------ ----
175-
d-r--- 12/11/2017 10:25 AM Microsoft.NET
176-
d----- 4/5/2017 4:34 PM SoftwareDistribution.bak
177-
-a---- 5/20/2017 10:54 AM 0 ativpsrm.bin
178-
-a---- 8/25/2008 10:31 PM 292352 atprs.exe
179-
-a---- 6/3/2017 1:21 PM 64512 bfsvc.exe
180-
-a--s- 12/11/2017 1:10 PM 67584 bootstat.dat
181-
-a---- 10/30/2015 10:48 AM 31816 CoreSingleLanguage.xml
182-
-a---- 10/8/2016 9:45 PM 232960 DfsrAdmin.exe
183-
-a---- 5/22/2017 10:24 AM 1315 DfsrAdmin.exe.config
184-
-a---- 12/10/2017 1:21 PM 1908 diagerr.xml
185-
-a---- 12/10/2017 1:21 PM 1908 diagwrn.xml
186-
-a---- 3/19/2017 12:29 AM 34774 Enterprise.xml
187-
-a---- 10/7/2015 2:11 AM 2238152 ETDUninst.dll
188-
-a---- 9/30/2017 9:12 AM 4848952 explorer.exe
189-
-a---- 6/3/2017 1:29 PM 975360 HelpPane.exe
190-
-a---- 3/19/2017 12:27 AM 18432 hh.exe
191-
-a---- 12/14/2016 10:57 AM 0 HPMProp.INI
192-
-a---- 3/19/2017 12:27 AM 43131 mib.bin
193-
-a---- 4/9/2008 6:00 PM 53478 mvtcpui.ini
194-
-a---- 3/19/2017 12:28 AM 246784 notepad.exe
195-
-a---- 11/29/2017 4:23 PM 686 PFRO.log
196-
-a---- 3/19/2017 12:27 AM 321024 regedit.exe
197-
-a---- 12/10/2017 1:21 PM 445 setupact.log
198-
-a---- 12/10/2017 1:16 PM 0 setuperr.log
199-
-a---- 3/19/2017 12:28 AM 130560 splwow64.exe
200-
-a---- 10/30/2015 10:51 AM 219 system.ini
201-
-a---- 3/19/2017 12:28 AM 65536 twain_32.dll
202122
```
203123

204124
This command gets items in the Windows directory with names that include a dot (.), but do not begin with w*.

0 commit comments

Comments
 (0)