win7 powershell配色方案
首先我是参考微软的word的, look~
要配置powershell很简单, 就几步
1.显示 Windows PowerShell 配置文件的路径
$profile
2.确定是否已经在系统上创建了 Windows PowerShell 配置文件,请键入:
test-path $profile
如果存在配置文件,则响应为 True:否则响应为 False。(我的显示是False)
3.创建 Windows PowerShell 配置文件,请键入:
new-item -path $profile -itemtype file -force
4.在记事本中打开配置文件,请键入:
notepad $profile
然后把下面的配置方案扔进去
set-alias ll Get-ChildItemColor function prompt
{
$my_path = $(get-location).toString()
$my_pos = ($my_path).LastIndexOf("\") + 1
if( $my_pos -eq ($my_path).Length ) { $my_path_tail = $my_path }
else { $my_path_tail = ($my_path).SubString( $my_pos, ($my_path).Length - $my_pos ) }
Write-Host ("[") -nonewline -foregroundcolor 'Green'
Write-Host ("Chenglee") -nonewline -foregroundcolor 'Red'
Write-Host ("@") -nonewline -foregroundcolor 'Yellow'
Write-Host ("WIN7 ") -nonewline -foregroundcolor 'Magenta'
Write-Host ($my_path_tail) -nonewline -foregroundcolor 'Blue'
Write-Host ("]#") -nonewline -foregroundcolor 'Green'
return " "
} function Get-ChildItemColor {
<#
.Synopsis
Returns childitems with colors by type.
.Description
This function wraps Get-ChildItem and tries to output the results
color-coded by type:
Directories - Cyan
Compressed - Red
Executables - Green
Text Files - Gray
Image Files - Magenta
Others - Gray
.ReturnValue
All objects returned by Get-ChildItem are passed down the pipeline
unmodified.
.Notes
NAME: Get-ChildItemColor
AUTHOR: Tojo2000 <tojo2000@tojo2000.com>
#>
$regex_opts = ([System.Text.RegularExpressions.RegexOptions]::IgnoreCase -bor [System.Text.RegularExpressions.RegexOptions]::Compiled)
$fore = $Host.UI.RawUI.ForegroundColor
$compressed = New-Object System.Text.RegularExpressions.Regex(
'\.(zip|tar|gz|rar|7z|tgz|bz2)', $regex_opts)
$executable = New-Object System.Text.RegularExpressions.Regex(
'\.(exe|bat|cmd|py|pl|ps1|psm1|vbs|rb|reg|sh)', $regex_opts)
$text_files = New-Object System.Text.RegularExpressions.Regex(
'\.(txt|cfg|conf|ini|csv|log)', $regex_opts)
$image_files = New-Object System.Text.RegularExpressions.Regex(
'\.(bmp|jpg|png|gif|jpeg)', $regex_opts) Invoke-Expression ("Get-ChildItem $args") |
%{
if ($_.GetType().Name -eq 'DirectoryInfo') { $Host.UI.RawUI.ForegroundColor = 'Cyan' }
elseif ($compressed.IsMatch($_.Name)) { $Host.UI.RawUI.ForegroundColor = 'Red' }
elseif ($executable.IsMatch($_.Name)) { $Host.UI.RawUI.ForegroundColor = 'Green' }
elseif ($text_files.IsMatch($_.Name)) { $Host.UI.RawUI.ForegroundColor = 'Gray' }
elseif ($image_files.IsMatch($_.Name)) { $Host.UI.RawUI.ForegroundColor = 'Magenta' }
else { $Host.UI.RawUI.ForegroundColor = 'Gray' }
echo $_
$Host.UI.RawUI.ForegroundColor = $fore
}
} function Show-Color( [System.ConsoleColor] $color )
{
$fore = $Host.UI.RawUI.ForegroundColor
$Host.UI.RawUI.ForegroundColor = $color
echo ($color).toString()
$Host.UI.RawUI.ForegroundColor = $fore
} function Show-AllColor
{
Show-Color('Black')
Show-Color('DarkBlue')
Show-Color('DarkGreen')
Show-Color('DarkCyan')
Show-Color('DarkRed')
Show-Color('DarkMagenta')
Show-Color('DarkYellow')
Show-Color('Gray')
Show-Color('DarkGray')
Show-Color('Blue')
Show-Color('Green')
Show-Color('Cyan')
Show-Color('Red')
Show-Color('Magenta')
Show-Color('Yellow')
Show-Color('White')
}
启动powershell(可能会报错, 不管它)执行下面命令:
Set-ExecutionPolicy RemoteSigned
选择Y
OK!
重新启动powershell!
。
以后要修改配置方案的话直接换C:\Users\hp\Documents\WindowsPowerShell目录下的Microsoft.PowerShell_profile.ps1文件即可。
win7 powershell配色方案的更多相关文章
- 解决提示“配色方案已更改为Windows7 Basic”
WIN7是很多用户都用过的系统,是由微软推出的.下面就说一个小技巧. 如何解决Win7系统提示:“配色方案已更改为Windows 7 Basic”解决方案. 更改Win7配色方案 首先,右击桌面空 ...
- QT Creater 配色方案及下载
打开QT Creater的工具--选项--文本编辑器--字体和颜色,复制一份配色方案:Vim (dark) ->Vim (dark) (copy) 更改想更改的任何内容的配色.其中,修改后的文件 ...
- 分享3个Putty配色方案【转】
本文转载自:https://www.coder4.com/archives/1506 分享3个Putty配色方案 4 Replies 虽然服务器都是Linux的,平时也基本用Linux,但是难免还是要 ...
- CodeBlocks 配色方案设置
最终效果(官方sublime修改版) 官方配色 codeblocks是一个功能很强大编程软件,我们在安装codeblocks后软件默认的是白底黑字界面,这种界面在长时间写代码时会对眼睛造成很大伤害,增 ...
- 改变linux默认配色方案(dircolors和dircolors-solarized使用)
前言 前几天刚买了阿里云的云服务器,今天使用putty进入服务器,发现linux默认的bash配色实在太丑. 特别是文件夹显示为深蓝色,到了白天,和黑色背景一搭配,根本看不清文字. 好在在github ...
- VisualStudio配色方案
最近发现一个很神奇的网站,可以方便的为VisualStudio配色:Studio Styles - Visual Studio color schemes 可以下载一份自己喜欢的配色方案 如果还不满意 ...
- 好看的IDE配色方案让代码看起来不再那么凶猛了
写这篇小文的初衷是,笔者是原教旨主义者,一直坚持用IDE默认的配色方案.另外也觉得网上黑色系的配色方案太过bling bling了.但今天尝试用新的配色方案后,兴奋地发现对代码的好感度大幅提升. 嗯, ...
- Sourceinsight最佳配色方案及颜色字体调整方法
在Ubuntu下面用Gedit有一款比较好看的配色,应该是Darkblue.按照那个样子在SI里面做了一个差不多的,按个人喜好,背景色换成黑色,如下所示: 配色的方案文件可以从此处链接免费下载: 配色 ...
- Visual Studio配色方案
Eclipse开源工具和VS在诸多方面真的是差距非常大,无奈Java编程,使用VS非常麻烦.所以只能选择Eclipse 但是Eclipse的系统配色,又实在是不舒服,于是抽时间,从VS上抠了一份默认的 ...
随机推荐
- heapy() :python自带的堆排序
堆是一个二叉树,其中每个父节点的值都小于或等于其所有子节点的值.整个堆的最小元素总是位于二叉树的根节点.python的heapq模块提供了对堆的支持. 堆数据结构最重要的特征是heap[0]永远是最小 ...
- svn中给个地址,然后把自己建立的项目拖进去
1.首先checkout 那个地址就会得到一个空的文件夹(里面有.svn文件) 2.把你的项目copy一下,粘贴到你chekout的文件夹里面,所有文件都是?,然后选中全部,点击add,然后在comm ...
- js语法没有任何问题但是就是不走,检查js中命名的变量名,用 service-area错误,改service_area (原)
js语法没有任何问题但是就是不走,检查js中命名的变量名,用 service-area错误,改service_area
- git 语法
$ git init // 初始化一个Git仓库 会生成一个.git目录 $ git status // 查看仓库的状态 $ git add . // 将所有修改添加到暂存区 $git ad ...
- hiho #1014 : Trie树(模板)
Trie树 [题目链接]Trie树 &题意: 输入 输入的第一行为一个正整数n,表示词典的大小,其后n行,每一行一个单词(不保证是英文单词,也有可能是火星文单词哦),单词由不超过10个的小写英 ...
- HDU 1568 Fibonacci(大数前4位)
转载自:http://blog.csdn.net/thearcticocean/article/details/47615241 分析:x=1234567.求其前四位数: log10(x)=log10 ...
- codeforces 185A Plant(推公式)
Plant [题目链接]Plant [题目类型]推公式 &题解: 这个是可以推公式的: 每年的总个数是4^n个,设n年时向上的个数是x个,向下的个数是y个,那么n+1年时,向上的个数是3* x ...
- uvm设计分析——tlm
tlm模块,用来在不同模块之间实现实时通信,主要基于两个定义在通信双方的port类来实现. 两个port之间,通过connect函数,来拿到双方的class指针,进而调用对方的function. 但是 ...
- 《大话设计模式》c++实现 原型模式
意图:用原型实例指定创建对象的种类,并且通过拷贝这些原型创建新的对象. 主要解决:在运行期建立和删除原型. 何时使用: 1.当一个系统应该独立于它的产品创建,构成和表示时. 2.当要实例化的类是在运行 ...
- html5随机背景颜色
<script>var colors=['red','blue','green','orange','yellow']; function bcolor(){ var ...