win7 powershell配色方案
首先我是参考微软的word的, look~
Windows PowerShell 配置文件
要配置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-ChildItemColorfunction prompt {$my_path = $(get-location).toString()$my_pos = ($my_path).LastIndexOf("\") + 1if( $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 { <# .SynopsisReturns childitems with colors by type. .DescriptionThis function wraps Get-ChildItem and tries to output the resultscolor-coded by type:Directories - CyanCompressed - RedExecutables - GreenText Files - GrayImage Files - MagentaOthers - Gray .ReturnValueAll objects returned by Get-ChildItem are passed down the pipelineunmodified. .NotesNAME: Get-ChildItemColorAUTHOR: 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 = $colorecho ($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文件即可。
转载于:https://www.cnblogs.com/chenglee/p/9167059.html
win7 powershell配色方案相关推荐
- 修改计算机配色方案,笔者教你win7提示配色方案已更改为Windows7 Basic怎么办
最近有位使用win7系统盆友反映在运行一些游戏的时候,系统不知道为何会自动切换配色而且在桌面的右下角还出现了这么的一个提示"配色方案已更改为Windows7 Basic",而这时a ...
- win7更改配色方案介绍~
经常会遇到Win7配色方案被更改,导致Win7界面变难看.还有些是在玩CF游戏时候桌面提示Win7配色方案被修改,导致原先的桌面配色方案被修改,很多朋友看着就觉得不舒服了,那么Win7怎么改配色方案, ...
- Win7改配色方案的方法
经常会遇到Win7配色方案被更改,导致Win7界面变难看.还有些是在玩CF游戏时候桌面提示Win7配色方案被修改,导致原先的桌面配色方案被修改,很多朋友看着就觉得不舒服了,那么Win7怎么改配色方案, ...
- win7运行java配色方案_技术编辑教您如何解决win7配色方案已更改为Windows7 Basic
很多时候,我们在使用电脑运行某款游戏的时候,系统都会自行切换配色方案并在右下角出现提示"配色方案已更改为Windows7 Basic",这时aero特效将暂时性的失效,但我们要怎样 ...
- jdk与win7配色方案不兼容
jdk1.5与win7的配色方案不兼容,启动Tomcat后,访问工程系统会提示更改win7配色方案为基本色, 后将jdk版本更换至1.6版本后,问题得到解决.
- win7运行java配色方案_技术编辑帮您win7系统运行游戏时提示配色方案已更改为Windows 7 Basic的恢复教程...
win7系统有很多人都喜欢使用,我们操作的过程中常常会碰到win7系统运行游戏时提示配色方案已更改为Windows 7 Basic的问题.如果遇到win7系统运行游戏时提示配色方案已更改为Window ...
- 解决w ndows7basic,win7出现提示“配色方案已更改为Windows7 Basic”该怎么解决
最近有使用win7系统的用户反馈说,电脑右下角时常会出现提示"配色方案已更改为Windows7 Basic,这在运行的程序和Windows某元素不兼容,该怎么办处理呢?今天小编就跟大家说说该 ...
- 游戏检测到计算机性能过低配色,Win7电脑提示是否要更改配色方案来提高性能窗口如何解决...
在使用Win7系统的过程中,总是会碰到各种各样的问题让用户不知所措,比如最近就有win7系统用户反映说电脑突然弹出窗口提示"是否要更改配色方案来提高性能",对此该如何解决呢?导致此 ...
- win7配色方案_自制的基于rime的简体拼音输入方案,尽可能接近搜狗拼音
简介 在linux端,很多拼音输入法有少许 bug 或卡顿,或功能不全,所以接触了 rime ,然而自带的朙月拼音和袖珍简化字拼音均不是很不是很理想,但是探索过程中发现很多很好的开源项目提供词库,而 ...
最新文章
- mysql中在表中insert数据时,有重复主键id时,变成update
- IOS_多线程_ASI_AFN_UIWebView
- System.Object 基类
- windows下python虚拟环境virtualenv安装和使用
- 二叉树的先序建树后序输出
- 回溯算法-02遍历所有组合方式问题
- md5 java代码_JAVA简单实现MD5注册登录加密实例代码
- 技术面试问项目难题如何解决的_同轴线如何当网线使用?解决改造项目中难题...
- oracle的order by排序中空字符串处理方法
- springboot整合mybatis 使用HikariCP连接池
- 【Flask-RESTPlus系列】Part2:响应编组
- 思想篇(1)--企业需要什么样的人才?
- Django中form字段操作
- 微软 .NET Core 3.0 版本发布
- 程序员为什么需要学会Markdown
- 几个通用有限元软件简介
- 免校准的电量计量芯片_应物联网而生:合力为HLW8012系列免校准电能计量芯片...
- 反向代理为何叫反向代理?(含案例)
- ArcGIS中将经纬度表格转为空间图层并制作采样点分布图
- 如何降低计算机版本,电脑系统WIN10如何降级,还原老系统_win10专业版教程