当前位置: 首页 > news >正文

网站全屏代码做公司网站要注意哪些问题

网站全屏代码,做公司网站要注意哪些问题,银川网站开发公司,大型网架加工厂某天闲得无聊想要通过 powershell 的脚本修改 powershell 的提示符,让 IDEA 的终端显示更加鲜艳简洁,最终做到如下效果 修改提示符颜色修改提示符提示普通用户和管理员权限修改路径表现形式修改项目根路径以 ~ 表示这是以管理员形式启动的IDEA&#xff0…

某天闲得无聊想要通过 powershell 的脚本修改 powershell 的提示符,让 IDEA 的终端显示更加鲜艳简洁,最终做到如下效果

  1. 修改提示符颜色
  2. 修改提示符提示普通用户和管理员权限
  3. 修改路径表现形式
  4. 修改项目根路径以 ~ 表示
    在这里插入图片描述
    这是以管理员形式启动的IDEA,这时候终端是有管理员权限的,所以样式被改变了
    在这里插入图片描述

实现流程

  1. 创建一个 ztp_function_idea.ps1 文件(该文件需要在配置在环境变量,如果没有则需要使用的时候键入完整路径)
function prompt {$dir = (Get-Location).Path;if ($null -eq $env:WORK) {$env:WORK = $dir}$name = $env:USERNAME.ToLower()# 定义路径映射:每个元素是路径表达式和对应简称的元组$PathAliases = @(@{ Path = $env:USERPROFILE; Alias = 'home' }@{ Path = $env:WORK; Alias = '~' }@{ Path = [Environment]::GetFolderPath('Desktop'); Alias = 'Desktop' }@{ Path = [Environment]::GetFolderPath('MyDocuments'); Alias = 'Documents' }@{ # Personal 文件夹且不等于 MyDocuments(避免重复)Path = { [Environment]::GetFolderPath('Personal') }; Condition = { $dir -eq $_.Invoke() -and $dir -ne [Environment]::GetFolderPath('MyDocuments') }Alias = 'Documents' }@{ Path = [Environment]::GetFolderPath('Startup'); Alias = 'Startup' }@{ Path = [Environment]::GetFolderPath('StartMenu'); Alias = 'StartMenu' }@{ Path = [Environment]::GetFolderPath('CommonStartup'); Alias = 'Startup' }@{ Path = [Environment]::GetFolderPath('CommonStartMenu'); Alias = 'StartMenu' }@{ Path = [Environment]::GetFolderPath('Favorites'); Alias = 'Favorites' }@{ Path = [Environment]::GetFolderPath([Environment+SpecialFolder]::ApplicationData); Alias = 'Roaming' }@{ Path = [Environment]::GetFolderPath('LocalApplicationData'); Alias = 'LocalAppData' }@{ Path = ${env:ProgramFiles(x86)}; Alias = 'ProgramFiles(x86)' }@{ Path = [Environment]::GetFolderPath('Templates'); Alias = 'Templates' }@{ Path = [Environment]::GetFolderPath('Recent'); Alias = 'Recent' }@{ Path = [Environment]::GetFolderPath('SendTo'); Alias = 'SendTo' }@{ Path = [Environment]::GetFolderPath([Environment+SpecialFolder]::NetworkShortcuts); Alias = 'NetHood' }@{ Path = [Environment]::GetFolderPath([Environment+SpecialFolder]::PrinterShortcuts); Alias = 'PrintHood' }@{ Path = [Environment]::GetFolderPath([Environment+SpecialFolder]::MyMusic); Alias = 'Music' }@{ Path = [Environment]::GetFolderPath([Environment+SpecialFolder]::MyPictures); Alias = 'Pictures' }@{ Path = [Environment]::GetFolderPath([Environment+SpecialFolder]::MyVideos); Alias = 'Videos' }@{ Path = { (New-Object -ComObject Shell.Application).Namespace('shell:Downloads').Self.Path }Alias = 'Downloads'}@{ Path = "$env:USERPROFILE\OneDrive"; Alias = 'OneDrive' }@{ Path = "$env:PROGRAMFILES\WindowsApps"; Alias = 'WindowsApps' }@{ Path = [Environment]::GetFolderPath('System'); Alias = 'System' }@{ Path = [Environment]::GetFolderPath('CommonApplicationData'); Alias = 'ProgramData' }@{ Path = [Environment]::GetFolderPath('ProgramFiles'); Alias = 'ProgramFiles' }@{ Path = $env:WINDIR; Alias = 'Windows' })$flag = 0# 遍历数组查找匹配项foreach ($item in $PathAliases) {$targetPath = if ($item.Path -is [scriptblock]) { $item.Path.Invoke() } else { $item.Path }if ($dir.StartsWith($targetPath, [System.StringComparison]::OrdinalIgnoreCase)) {if ($item.Condition) {if($item.Condition.Invoke()){}}$relative = $( $suffix = $dir.Substring($targetPath.Length).TrimStart('\'); "/$suffix".TrimEnd('/') )$dir = $item.Alias + $relative$result = if ($item.Alias -eq '~') { '' } else { '/' }$dir = $result + $dir.Replace('\', '/').Replace(':', '/') -replace '/+', '/'$flag = 1break}}$dir = $dir.ToLower()if ($flag -eq 0) {# $dir = '/' + $dir.ToLower().Replace('\', '/').Replace(':', '/') -replace '/+', '/'$dir = '/' + $dir.Replace('\', '/').Replace(':', '/') -replace '/+', '/'$dir = $dir -replace '/$',''}# ✅ ANSI 控制字符$ESC = [char]27$GREEN_BOLD = "$ESC[1;32m"   # 加粗 + 绿色$BLUE       = "$ESC[34m"     # 蓝色$RESET      = "$ESC[0m"      # 重置(关闭所有样式)$isAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)$userPart     = "root@$name"$pathPart     = $dir$promptChar   = "# "if (!$isAdmin) {$userPart     = "$name@$name"$promptChar   = "$ "}# 组合输出:绿色加粗用户名 + 重置后加冒号 + 蓝色路径 + 重置 + 提示符"$GREEN_BOLD$userPart$RESET`:$BLUE$pathPart$RESET$promptChar"# "root@$name`:$dir# " 
}# todo 启动一个终端并应用上面的函数 %SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoExit chcp 65001
  1. 修改 IDEA 终端的路径
c:\windows\system32\windowspowershell\v1.0\powershell.exe  -NoExit -Command "chcp 65001; . 'ztp_function_idea'"

在这里插入图片描述

http://www.dtcms.com/a/567168.html

相关文章:

  • 深圳高端网站设计公司企业网站推广的线上渠道有哪些
  • 网页设计制作网站html代码大全顺德网站建设找顺的
  • 网站做电话线用试列出网站开发建设的步骤
  • 茶网站开发的意义目的个人seo怎么赚钱
  • 外贸专业网站jsp做的求职招聘网站百度云
  • 布吉建网站石家庄百度推广总代理
  • 做招聘网站的怎么引流求职者aspx高性能网站建设
  • 邢台专业网站建设网站源码中国有限公司
  • 烟台网站开发技术微信开放平台怎么申请
  • 烟台网站建设方案书免费表白网页在线生成制作
  • python 连接 tekla pythonnet
  • 网站制作营销型怎样做diy家具网站
  • 河北省城乡建设厅网站网络科技有限公司有哪些
  • 企业查询平台seo推广技术
  • 找人做网站排名优化以营销网建为
  • 商务网站建设数据处理网站是怎么制作出来的
  • 个人网站设计模板下载静态网站怎么做百度推广
  • 无锡制作网站吕梁推广型网站建设
  • 微信网站公司品牌建设网站有哪些
  • 手机上怎么做自己卖菜的网站网站建设需要哪些的ps
  • 荥阳建设网站wordpress数据库缓存
  • 萤石摄像头使用飞牛NAS作为存储的操作方法
  • 深圳集团网站开发网站开发公司电话重庆电子工程职业学院就业网官网
  • 中国建设银行网站查余额网上商城互联网网站开发
  • 建设一个网站需要哪些费用泉州 网站制作
  • 如何做婚恋网站创意设计网
  • 扁平风格企业网站源码赣州梦幻网络科技有限公司
  • 网站如何不被百度搜到网站主页面设计哪个好
  • 湖南建筑信息一体化管理平台网站seo优化的重要性
  • 建设平台类网站需要多少钱国外在线crm系统suitecrm