如何在Powershell中为文件列表设置颜色 [英] How do I set color in powershell for file listing

查看:39
本文介绍了如何在Powershell中为文件列表设置颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我更喜欢ls使其列表变色以突出显示不同文件类型的功能.因此,我创建了自己的ps1xml文件,并一直在调整FileSystemTypes的格式.很好玩,我还没有伤到自己呢!

I rather like ls's ability to colorize its listing to highlight different file types. So I've created my own ps1xml file and have been tweaking the format for the FileSystemTypes. Great fun and I haven't hurt myself too badly yet!

我已经能够更改字段的内容和格式(例如,按我的喜好使LastModifiedTime列更多),但是我不知道如何更改颜色.这可能吗?我对PowerShell有点陌生,那里有很多东西,所以我很可能会遗漏一些明显的东西.

I've been able to change the contents and formatting of a field (for example, making the LastModifiedTime column a little more to my liking), but I don't know how to change the color. Is this possible? I'm a little new to PowerShell and there's a lot there, so I might well be missing something obvious.

感谢任何提示.

推荐答案

这些是一些讨论 get-childitem 输出颜色的链接.

These are some links that discuss about the coloring of get-childitem output.

Get-ChildItem(dir)结果按类型进行颜色编码
如何编写排序的列表在字典上按列列出的网格中是按字母顺序排列的吗?
Powershell着色目录列表与整个格式不正确

这篇关于如何在Powershell中为文件列表设置颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆