vsphere关于windows模版的一些笔记


简介

关于vsphere windows类系统的模版所包含的一些步骤
比较符合个人习惯的

步骤

  1. 开启mstsc,取消仅允许运行使用网络级别身份验证的远程桌面的计算机连接
  2. 设置输入法默认为英文
  3. 电源选择为不休眠,关闭显示屏
  4. 安装7zip,chrome,miniconda3,everything,sublime text3
  5. chrome首页设置为https://www.baidu.com/?pu=sz%401321_480&wpo=btmfast,搜索设置为bing,开启下载询问。chrome固定到任务栏
  6. 取消复选框,显示隐藏文件,打开拓展名
  7. 安装windows terminal
  8. 安装vmtools并且自动更新
  9. 进行激活
  10. 桌面个性化设置,cortana隐藏搜索栏
  11. 取消onedrive开机启动
  12. 快捷栏去除不需要的图标
  13. 退出安装光盘
  14. sublime设置为
    {
    "font_size": 18,
    "ignored_packages":
    [
        "Vintage"
    ],
    "tab_size": 4,
    "translate_tabs_to_spaces": true,
    "update_check": false,
    "word_wrap":true
    }
    
  15. 打开粘贴板历史记录
  16. 设置代理

安装windows terminal

基本上参考 https://zhuanlan.zhihu.com/p/137595941

1. Microsoft Store 下载安装 Windows Terminal

2. 安装Fira code字体

https://github.com/tonsky/FiraCode/releases

选择最新的下载,然后ttf文件夹下全选安装

3. 安装新款 Powershell Core

https://github.com/PowerShell/PowerShell/releases

选择合适架构下载安装

4. 安装Powershell插件

打开刚装好的新版 powershell

# 1. 安装 PSReadline 包,该插件可以让命令行很好用,类似 zsh
Install-Module -Name PSReadLine -AllowPrerelease -Force -Verbose

# 2. 安装 posh-git 包,让你的 git 更好用
Install-Module posh-git -Scope CurrentUser -Verbose

# 3. 安装 oh-my-posh 包,让你的命令行更酷炫、优雅
Install-Module oh-my-posh -Scope CurrentUser -Verbose

有不信任直接Y

5. 配置 Windows Terminal

settings.json
注意修改commandline

// This file was initially generated by Windows Terminal 1.0.1401.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.

// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
  "$schema": "https://aka.ms/terminal-profiles-schema",

  //"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
  "defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",

  // You can add more global application settings here.
  // To learn more about global settings, visit https://aka.ms/terminal-global-settings

  // If enabled, selections are automatically copied to your clipboard.
  "copyOnSelect": true,

  // If enabled, formatted data is also copied to your clipboard
  "copyFormatting": false,

  // A profile specifies a command to execute paired with information about how it should look and feel.
  // Each one of them will appear in the 'New Tab' dropdown,
  //   and can be invoked from the commandline with `wt.exe -p xxx`
  // To learn more about profiles, visit https://aka.ms/terminal-profile-settings
  "profiles": {

    "defaults": {
      //   // Put settings here that you want to apply to all profiles.
      //   "initialCols": 120,
      //   "initialRows": 30,
      //   "useAcrylic": false,
      //   //"backgroundImage": "C:\\Users\\xyzz\\Pictures\\Camera Roll\\v2-ff0bf88c3ae2817aabbe0a3346b57547_r.jpg",
      //   "backgroundImageOpacity": 0.8,
      //   // 亮色或暗色主题,可选值 "light", "dark", "system"
      //   "requestedTheme": "Snazzy",
      //   // 合并标题栏和标签栏
      //   "showTabsInTitlebar": true,
      //   // 如果 showTabsInTitlebar 与本值同为 false 时,自动隐藏标签栏
      //   "alwaysShowTabs": true,
      //   // 在标题栏上显示当前活动标签页的标题
      //   "showTerminalTitleInTitlebar": true,
      //   // 双击选择时用于分词的字符
      //   "wordDelimiters": " /\\()\"'-.,:;<>~!@#$%^&*|+=[]{}~?\u2502",
      //   // 选择时复制到剪贴板
      //   "copyOnSelect": true,
      //   "foreground": "#2BB3D5"
    },
    "list": [
      {
        // Powershell 7.1.0-preview.2 配置
        "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
        "hidden": false,
        "name": "pwsh",
        // 注意:一定要写上 -nologo,否则开启 powershll 会有一段话输出,很讨厌!
        // 这儿看个人的位置
        "commandline": "C:/Program Files/PowerShell/7-preview/pwsh.exe -nologo",
        "source": "Windows.Terminal.PowershellCore",
        // 启动菜单一定要设置为 <.>,否则后面重要的一步将会无效!
        "startingDirectory": ".",
        // 字体
        "fontFace": "Fira Code",
        "fontSize": 11,
        "historySize": 9001,
        "padding": "5, 5, 20, 25",
        "snapOnInput": true,
        "useAcrylic": false,
        // 颜色
        "colorScheme": "Snazzy"
      },
      {
        // Make changes here to the powershell.exe profile.
        "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
        "name": "Windows PowerShell",
        "commandline": "powershell.exe",
        "hidden": false
      },
      {
        // Make changes here to the cmd.exe profile.
        "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
        "name": "命令提示符",
        "commandline": "cmd.exe",
        "hidden": false
      }
      //,{
      //  "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
      //  "hidden": false,
      //  "name": "PowerShell",
      //  "source": "Windows.Terminal.PowershellCore"
      //}
    ]
  },

  // Add custom color schemes to this array.
  // To learn more about color schemes, visit https://aka.ms/terminal-color-schemes
  "schemes": [
    {
      "name": "Snazzy",
      "black": "#000000",
      "red": "#fc4346",
      "green": "#50fb7c",
      "yellow": "#f0fb8c",
      "blue": "#49baff",
      "purple": "#fc4cb4",
      "cyan": "#8be9fe",
      "white": "#ededec",
      "brightBlack": "#555555",
      "brightRed": "#fc4346",
      "brightGreen": "#50fb7c",
      "brightYellow": "#f0fb8c",
      "brightBlue": "#49baff",
      "brightPurple": "#fc4cb4",
      "brightCyan": "#8be9fe",
      "brightWhite": "#ededec",
      "background": "#1e1f29",
      "foreground": "#ffffff"
    },
    {
      "name": "Homebrew",
      "black": "#000000",
      "red": "#FC5275",
      "green": "#00a600",
      "yellow": "#999900",
      "blue": "#6666e9",
      "purple": "#b200b2",
      "cyan": "#00a6b2",
      "white": "#bfbfbf",
      "brightBlack": "#666666",
      "brightRed": "#e50000",
      "brightGreen": "#00d900",
      "brightYellow": "#e5e500",
      "brightBlue": "#0000ff",
      "brightPurple": "#e500e5",
      "brightCyan": "#00e5e5",
      "brightWhite": "#e5e5e5",
      "background": "#283033",
      "foreground": "#ffffff"
    }
  ],

  // Add custom keybindings to this array.
  // To unbind a key combination from your defaults.json, set the command to "unbound".
  // To learn more about keybindings, visit https://aka.ms/terminal-keybindings
  "keybindings": [
    // Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
    // These two lines additionally bind them to Ctrl+C and Ctrl+V.
    // To learn more about selection, visit https://aka.ms/terminal-selection
    {
      "command": {
        "action": "copy",
        "singleLine": false
      },
      "keys": "ctrl+c"
    },
    {
      "command": "paste",
      "keys": "ctrl+v"
    },

    // Press Ctrl+Shift+F to open the search box
    {
      "command": "find",
      "keys": "ctrl+shift+f"
    },

    // Press Alt+Shift+D to open a new pane.
    // - "split": "auto" makes this pane open in the direction that provides the most surface area.
    // - "splitMode": "duplicate" makes the new pane use the focused pane's profile.
    // To learn more about panes, visit https://aka.ms/terminal-panes
    {
      "command": {
        "action": "splitPane",
        "split": "auto",
        "splitMode": "duplicate"
      },
      "keys": "alt+shift+d"
    }
  ]
}

6. 右键配置

保存为right_click.reg
修改自己的位置
Icon 根据需求自己配,我就直接放弃了
terminal.ico

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\WindowsTerminal]
@="Open Windows Terminal here"
"Icon"="C:\\Users\\xyzz\\AppData\\Local\\WTerminal\\terminal.ico"

[HKEY_CLASSES_ROOT\Directory\shell\WindowsTerminal\command]
@="C:\\Users\\xyzz\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe -d %V"

[HKEY_CLASSES_ROOT\Directory\Background\shell\WindowsTerminal]
@="Open Windows Terminal here"
"Icon"="C:\\Users\\xyzz\\AppData\\Local\\WTerminal\\terminal.ico"

[HKEY_CLASSES_ROOT\Directory\Background\shell\WindowsTerminal\command]
@="C:\\Users\\xyzz\\AppData\\Local\\Microsoft\\WindowsApps\\wt.exe -d %V"

7. 主题配置

notepad $PROFILE

<#
 * FileName: Microsoft.PowerShell_profile.ps1
 * Author: 刘 鹏
 * Email: littleNewton6@outlook.com
 * Date: 2020, May. 1
 * Copyright: No copyright. You can use this code for anything with no warranty.
#>


#------------------------------- Import Modules BEGIN -------------------------------
# 引入 posh-git
Import-Module posh-git

# 引入 oh-my-posh
Import-Module oh-my-posh

# 设置 PowerShell 主题
Set-Theme Paradox
#------------------------------- Import Modules END   -------------------------------





#-------------------------------  Set Hot-keys BEGIN  -------------------------------
# 设置 Tab 键补全
# Set-PSReadlineKeyHandler -Key Tab -Function Complete

# 设置 Ctrl+d 为菜单补全和 Intellisense
Set-PSReadLineKeyHandler -Key "Tab" -Function MenuComplete

# 设置 Ctrl+d 为退出 PowerShell
Set-PSReadlineKeyHandler -Key "Ctrl+d" -Function ViExit

# 设置 Ctrl+z 为撤销
Set-PSReadLineKeyHandler -Key "Ctrl+z" -Function Undo

# 设置向上键为后向搜索历史记录
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward

# 设置向下键为前向搜索历史纪录
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
#-------------------------------  Set Hot-keys END    -------------------------------





#-------------------------------    Functions BEGIN   -------------------------------
# Python 直接执行
$env:PATHEXT += ";.py"

# 更新 pip 的方法
function Update-Packages {
    # update pip
    Write-Host "Step 1: 更新 pip" -ForegroundColor Magenta -BackgroundColor Cyan
    $a = pip list --outdated
    $num_package = $a.Length - 2
    for ($i = 0; $i -lt $num_package; $i++) {
        $tmp = ($a[2 + $i].Split(" "))[0]
        pip install -U $tmp
    }

    # update TeX Live
    $CurrentYear = Get-Date -Format yyyy
    Write-Host "Step 2: 更新 TeX Live" $CurrentYear -ForegroundColor Magenta -BackgroundColor Cyan
    tlmgr update --self
    tlmgr update --all
}
#-------------------------------    Functions END     -------------------------------





#-------------------------------   Set Alias Begin    -------------------------------
# 1. 编译函数 make
function MakeThings {
    nmake.exe $args -nologo
}
Set-Alias -Name make -Value MakeThings

# 2. 更新系统 os-update
Set-Alias -Name os-update -Value Update-Packages

# 3. 查看目录 ls & ll
function ListDirectory {
    (Get-ChildItem).Name
    Write-Host("")
}
Set-Alias -Name ls -Value ListDirectory
Set-Alias -Name ll -Value Get-ChildItem
#-------------------------------    Set Alias END     -------------------------------

结束

windows 模版机over
删去快照,做成模版
由于是模板机,所以没有安装git,需要的时候再安装,但是保留了posh-git

更新

windows sublime添加右键文件夹脚本
1.reg

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT*\shell\SublimeText3]
@="Open in SublimeText3"
"Icon"="\"c:\Program Files\Sublime Text 3\sublime_text.exe\""

[HKEY_CLASSES_ROOT*\shell\SublimeText3\command]
@="\"c:\\Program Files\\Sublime Text 3\\sublime_text.exe\" \"%1\""

[HKEY_CLASSES_ROOT\Directory\shell\SublimeText3]
@="Open Directory in SublimeText3"
"Icon"="\"c:\\Program Files\\Sublime Text 3\\sublime_text.exe\""

[HKEY_CLASSES_ROOT\Directory\shell\SublimeText3\command]
@="\"c:\\Program Files\\Sublime Text 3\\sublime_text.exe\" \"%1\""

更新2

添加cpu和内存的热插拔


文章作者: xyzz
文章链接: http://www.xyzzpwn.top
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 xyzz !
 上一篇
关于parallels重置密码的一些记录 关于parallels重置密码的一些记录
简介parallels 14.1.3虚拟机macos 10.15.6前提是对用户写了ssh公钥,只是忘了密码无法登陆 重置root密码网上找的 #!/bin/bash # reset passowrd of parallels deskto
2020-09-06
下一篇 
win10 2004版本的一些折腾 win10 2004版本的一些折腾
简介包含以下内容 win10 2004 hyper-V vmware共存 win10 开启sandbox win10 开启wsl2 wsl2的备份与还原 wsl2安装docker 前置开启以下功能 Hyper-v Windows 沙盒
  目录