Today I will tell you about how to use PowerShell command with DIR command with filters.
Let’s see some examples with outputs:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | PS C:\Python364> help dir NAME Get-ChildItem SYNTAX Get-ChildItem [[-Path] <string[]>] [[-Filter] ] [-Include <string[]>] [-Exclude <string[]>] [-Recurse] [-Force] [-Name] [-UseTransaction] [-Attributes <FlagsExpression[FileAttributes]> {ReadOnly | Hidden | System | Directory | Archive | Device | Normal | Temporary | SparseFile | ReparsePoint | Compressed | Offline | NotContentIndexed | Encrypted | IntegrityStream | NoScrubData}] [-Directory] [-File] [-Hidden] [-ReadOnly] [-System] [] Get-ChildItem [[-Filter] ] -LiteralPath <string[]> [-Include <string[]>] [-Exclude <string[]>] [-Recurse] [-Force] [-Name] [-UseTransaction] [-Attributes <FlagsExpression[FileAttributes]> {ReadOnly | Hidden | System | Directory | Archive | Device | Normal | Temporary | SparseFile | ReparsePoint | Compressed | Offline | NotContentIndexed | Encrypted | IntegrityStream | NoScrubData}] [-Directory] [-File] [-Hidden] [-ReadOnly] [-System] [] ALIASES gci ls dir REMARKS Get-Help cannot find the Help files for this cmdlet on this computer. It is displaying only partial help. -- To download and install Help files for the module that includes this cmdlet, use Update-Help. -- To view the Help topic for this cmdlet online, type: "Get-Help Get-ChildItem -Online" or go to http://go.microsoft.com/fwlink/?LinkID=113308. ... PS C:\Python364> dir Directory: C:\Python364 Mode LastWriteTime Length Name ---- ------------- ------ ---- d---- 11/1/2018 8:28 PM build d---- 2/15/2019 1:53 PM catafest da--- 2/15/2019 1:53 PM catafest_jupyter-book d---- 12/17/2018 11:51 AM data d---- 11/1/2018 8:38 PM dist d---- 9/7/2018 3:04 PM djangowebsite d---- 9/7/2018 3:05 PM djangowebsite001 d---- 3/23/2018 11:32 PM DLLs ... PS C:\Python364> dir | Sort Directory: C:\Python364 Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 12/28/2018 8:47 PM 67 __main__.py d---- 2/15/2019 12:10 AM __pycache__ -a--- 12/20/2018 3:13 PM 7107 _frame_0.jpg -a--- 12/20/2018 3:13 PM 7107 _frame_135.jpg -a--- 8/29/2018 9:58 AM 64 aaa.vir -a--- 2/15/2019 12:25 AM 1366 aiohttp_001.py -a--- 1/2/2019 12:58 AM 23187 all_one.jpg -a--- 1/28/2019 1:18 PM 241734 Anonymized20190128.dcm -a--- 6/1/2018 3:56 PM 2628 asciimatics_001.py -a--- 2/14/2019 11:56 PM 1536 asyncio_example.py -a--- 12/20/2018 1:33 PM 162 black.png ... PS C:\Python364> dir | Sort CreationTime -Descending Directory: C:\Python364 Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 2/16/2019 11:55 PM 870 shapes_002.py -a--- 2/16/2019 11:45 PM 725 ORB_001.py -a--- 2/16/2019 10:24 PM 318772 sky_shapes.png -a--- 2/16/2019 10:41 PM 944 shapes_001.py da--- 2/15/2019 1:53 PM catafest_jupyter-book d---- 2/15/2019 1:53 PM catafest d---- 2/15/2019 12:44 PM mybookname -a--- 2/15/2019 12:38 PM 2526 notebook_tk_001.py -a--- 2/15/2019 12:59 AM 138 folium_001.py ... PS C:\Python364> dir | Get-ChildItem -Filter Encrypted Directory: C:\Python364 Mode LastWriteTime Length Name ---- ------------- ------ ---- -a--- 8/29/2018 9:58 AM 64 aaa.vir -a--- 2/15/2019 12:25 AM 1366 aiohttp_001.py -a--- 1/2/2019 12:58 AM 23187 all_one.jpg -a--- 1/28/2019 1:18 PM 241734 Anonymized20190128.dcm -a--- 6/1/2018 3:56 PM 2628 asciimatics_001.py -a--- 2/14/2019 11:56 PM 1536 asyncio_example.py -a--- 12/20/2018 1:33 PM 162 black.png -a--- 1/28/2019 3:17 PM 27473814 bmode.dcm -a--- 10/22/2018 9:21 PM 2955 calculator.py -a--- 10/24/2018 3:10 PM 1281 camera.py -a--- 12/20/2018 1:28 PM 155735 cells.jpg -a--- 1/28/2019 1:04 PM 84392 cells_gray.jpg -a--- 8/29/2018 8:36 PM 131 cha.py -a--- 6/5/1999 4:18 AM 525968 CT-MONO2-16-brain -a--- 6/11/2018 7:35 PM 410 cv2_webcam_001.py -a--- 6/11/2018 7:40 PM 4715 cv2_webcam_002.py -a--- 11/6/2018 3:55 PM 3376 delegate_001.py -a--- 12/20/2018 5:32 PM 18230 detect_video.py -a--- 12/20/2018 5:39 PM 1542 detect_video_002.py -a--- 3/10/2018 11:57 PM 1408 deviantart_friends.py -a--- 9/16/2018 8:19 PM 12 djproj.bat -a--- 12/25/2018 10:52 PM 1017 dragon.py -a--- 12/25/2018 10:54 PM 11197764 dragon.tar.gz -a--- 1/28/2019 3:17 PM 39846490 E1154S7I.dcm -a--- 12/20/2018 3:58 PM 91853 everest.jpg -a--- 11/29/2018 9:54 PM 3906 exit.png |