F
F
fastboot2021-11-28 19:11:12
PowerShell
fastboot, 2021-11-28 19:11:12

PowerShell get rid of displaying additional information in the console?

Code:
Get-ChildItem -Path C:/ –Directory
Output:

Каталог: C:\


Mode                 LastWriteTime         Length Name                                                                 
----                 -------------         ------ ----                                                                 
d-----     30.03.2021 Вт  10:07 ДП                EFI                                                                  
d-----     07.12.2019 Сб  11:14 ДП                PerfLogs                                                             
d-----     25.08.2021 Ср   6:56 ПП                php                                                                  
d-r---     27.11.2021 Сб   8:03 ПП                Program Files                                                        
d-r---     25.11.2021 Чт   9:30 ПП                Program Files (x86)                                                  
d-----     09.10.2021 Сб   5:50 ПП                RetroArch-Win64                                                      
d-----     27.07.2021 Вт   6:37 ПП                tools                                                                
d-r---     30.03.2021 Вт  10:55 ДП                Users                                                                
d-----     12.11.2021 Пт  10:20 ПП                Windows

I want to get only the list of folders, for further processing of the code

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MaxKozlov, 2021-11-28
@fastboot

There are actually a lot of options.

(Get-ChildItem -Path C:/  –Directory) .Name
Get-ChildItem -Path C:/  –Directory  | Select-Object ExpandProperty Name

And all of them are on the very first pages of any introductory Powershell article.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question