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上抠了一份默认的 ...
随机推荐
- Kotlin enum class 匿名类实例
Kotlin里的枚举类里有新玩意:就是枚举类的常量可以同时看成是一个同名匿名类 既然是类就可以与方法关联 看看官网的代码 如果你有过其它语言的使用枚举的经历,你可能对这个定义和说明很迷惑 我给你一个例 ...
- iOS UI基础-11.0 UINavigationController
导航控制器 利用UINavigationController,可以轻松地管理多个控制器,轻松完成控制器之间的切换,典型例子就是系统自带的“设置”应用 UINavigationController的使用 ...
- SQL Server之获取下周一的日期
今天项目中需要得到下周一的日期,故想到了一种解决办法,用slq语句解决了.当然实现方法肯定不只有这一种. -(select DATEPART(weekday,getdate())) /*下周一差几天 ...
- unity3d-角色控制器续
自学是一个坚持和寂寞的过程,写博客更是一个总结与成长的过程,加油! 角色控制器续 之前学习了角色漫游,但里面有很多效果都不是我想要的.只有自己的动手实践了才能理会其中的奥妙.所以我又琢磨了许久. 为了 ...
- Thinkphp 3.2 验证码图片显示错误解决方法
在调用验证码之前加上 ob_clean(); 不显示验证码的代码: public function verify(){ $verify = new \Think\Verify(); $verify-& ...
- Bootstrap-全局CSS样式-图片样式
Bootstrap第二部分:全局CSS样式-图片样式.img-rounded 圆角图片.img-circle 圆形图片.img-thumbnail 缩略图片.img-responsive响应 ...
- mybatis batchinsert
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE mapper PUBLIC "-/ ...
- PB窗体之间进行传递参数
例:A窗口传递给B窗口y A窗口: 定义参数名称并赋值String s_parm s_parm=username+'%'+password,然后openwithparm(w_main,s_parm) ...
- numpy高级应用
reshape重塑数组 ravel 拉平数组 concatenate 最一般化的连接,沿一条轴连接一组数组 # print(np.concatenate([arr1,arr2],axis = 0)) ...
- webview相关知识
标签类 1.Web App 建议用的样式 用于覆盖 WebView 默认的样式,使得 App 看起来更像原生的 App,——“不露出马脚” /* document.documentElement.st ...