初始化Windows系统的一些必要操作

软件篇

初始化一键安装必备软件

右键点击开始菜单,powershell(管理员)运行下面脚本

iex ((New-Object System.Net.WebClient).DownloadString('https://githubcontent.aiurs.co/gxhao2020/configuration-script-win/main/install.ps1'))

安装winget

winget 是微软推出的命令行工具,可以输入简单的命令安装常用软件,参考这里

Install Winget
if (-not $(Get-Command winget -ErrorAction SilentlyContinue)) {
    Write-Host "Installing WinGet..." -ForegroundColor Green
    Start-Process "ms-appinstaller:?source=https://aka.ms/getwinget"
    while(-not $(Get-Command winget -ErrorAction SilentlyContinue))
    {
        Write-Host "Winget is still not found!" -ForegroundColor Yellow
        Start-Sleep -Seconds 5
    }
}

软件链接

xdown
mgnb
Auto Dark Model
有道云笔记
ZeroTier
Utools

通过powershell默认安装exe软件。

https://stackoverflow.com/questions/47110728/powershell-download-and-run-exe-file

https://stackoverflow.com/questions/45756791/install-software-using-powershell-script?rq=1

设置篇

设置Windows投影默认为第二屏幕

https://answers.microsoft.com/zh-hans/windows/forum/all/关于win10的投影/e80b6da9-31c8-4b1a-a3df-4d91b3c6f974?auth=1

  1. 点击开始按钮>输入cmd>右键点击搜索结果中的"命令提示符">以管理员身份运行

  2. 在打开的命令提示符窗口中运行:

 notepad C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\SecondOnly.bat
  1. 确认新建文件,粘贴下面内容到记事本中:
@echo off

DisplaySwitch.exe /external
  1. 保存并关闭记事本程序

  2. 重启电脑看一下是否成功了呢

完全删除小组件

# 卸载
winget uninstall MicrosoftWindows.Client.WebExperience_cw5n1h2txyewy
# 安装
winget install 9MSSGKG348SP

配置ssh私钥

git config --global user.name 'gxhao'  
git config --global user.email '1625546088@qq.com'
# 生成密钥(注意设置git账号密码
ssh-keygen -t rsa -C '1625546088@qq.com'
# 检测是否配置成功
 ssh -T git@github.com

配置idea插件地址

https://plugins.zhile.io

jrebel 激活

http://jrebel.whrj999.com/3d64b43e-0da7-40a3-925a-844e5a57aea8

设置git代理

iex ((New-Object System.Net.WebClient).DownloadString('https://gist.githubusercontent.com/162554/b14669da81dd9574cc7ae34955be7fbe/raw/86a5b82f47a8f5e9c822a749782dc08e6d59b230/SetProxy.psm1'))
$ git config --global git.proxy http://127.0.0.1:1080
$ git config --global http.proxy http://127.0.0.1:1080
$ git config --global https.proxy http://127.0.0.1:1080
http.https://github.com.proxy=socks5://127.0.0.1:10808

# ssh 方式(在.ssh目录新建config)
# github
Host *github.com
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/id_rsa
  ProxyCommand connect -S 127.0.0.1:7890 -a none %h %p

激活Windows

https://msguides.com/windows-11

slmgr /ipk W269N-WFGWX-YVC9B-4J6C9-T83GX
# 获取激活服务器地址   https://kms.msguides.com/
slmgr /skms s8.uk.to
slmgr /ato

FAQ

锁屏桌面壁纸不更新

我刚刚解决了这个问题。先将"Windows 聚焦" 改为 "图片",再删除C:\Users\gxhao\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\Settings
目录下settings.datroaming.lock这两个文件。(注意是隐藏的文件)再 由 "图片" 改回 "Windows 聚焦"。稍等,OK!

之后就可以看到:
...\Microsoft.Windows.ContentDeliveryManager_***\LocalState\Assets
文件夹里下载了一批聚焦图片
..\Microsoft.Windows.ContentDeliveryManager_***\settings
目录下重新生成了settings.dat文件。

posted @ 2022-01-27 00:21  gxhao  阅读(477)  评论(0编辑  收藏  举报