A PowerShell module that displays a colorized directory and file listing with icons. Inspired by colorls
PowerColorLS is a PowerShell module that displays a colorized directory and file listing with icons in the terminal.
For the module to work, you must first install Terminal-Icons and (now terminal icon is no need)setup the Nerd Fonts
To install the module from the PowerShell Gallery:
Install-Module -Name PowerColorLS_GH -Repository PSGallery
Import-Module PowerColorLS_GH
PowerColorLS
List all files and directories including hidden ones and ones starting with '.' in long listing (wide) format
PowerColorLS -a -l
List all files and directories including hidden ones and ones starting with '.' in long listing (wide) format and also include directory size
PowerColorLS -a -l --show-directory-size
List files only, followed by list directories only
PowerColorLS -f
PowerColorLS -d
Listing files in a git directory displays git status as well
PowerColorLS
To get help about available arguments, run:
PowerColorLS --help
Output of help command:
Usage: PowerColorLs [OPTION]... [FILE]...
List information about files and directories (the current directory by default).
Entries will be sorted alphabetically if no sorting option is specified.
-a, --all do not ignore hidden files and files starting with .
-l, --long use a long listing format
-r, --report shows a brief report
-1 list one file per line
-d, --dirs show only directories
-f, --files show only files
-ds, -sds, --sds, --show-directory-size
show directory size (can take a long time)
-hi, --hide-icons hide icons
sorting options:
-sd, --sort-dirs, --group-directories-first
sort directories first
-sf, --sort-files, --group-files-first
sort files first
-t, -st, --st
sort by modification time, newest first
general options:
-h, --help prints this help
-v, --version show version information
Set-Alias -Name ls -Value PowerColorLS -Option AllScope
- 识别
Junction
和SymbolicLink
并且可以显示源地址,同时Mode也能显示链接属性。这两种情况会忽略主题里的配置,因为都显示源链接当然知道是链接 - 修复当文件或文件夹名长度大于Terminal宽度时多输出一行问题
- 宽度对齐适配中文
使用Terminal-Icons-Data
文件夹内容覆盖ModuleTerminal-Icons/Data
文件夹,修复git默认颜色失效,同时默认前景色将写在主题配置里而不是代码里(空属性所示color)- Terminal-Icons-Data补充多个类型icon和color
- 长列表隐藏icon时名称对齐
ls -a -l
(长列表显示所有文件)忽略宽度比较强制输出所有属性- 隐藏文件的判断标准不再是
.
开头的文件,而是以系统属性为准 ls -sd
ls -sf
文件夹优先和文件优先的同时也会排序名称
2021.12.19:
- 因为修改东西较多,把terminal icon 并入该项目
- 开始使用自己的module
- 修复git不显示文件夹状态
- 添加alias
l, ll, la, lr, l1, ld, lf, lt, lds, lhi