diff --git a/source/_posts/PowerShell.md b/source/_posts/PowerShell.md index 809131e..3f33a5d 100644 --- a/source/_posts/PowerShell.md +++ b/source/_posts/PowerShell.md @@ -541,6 +541,9 @@ Install-Module PSFzf -Scope CurrentUser -Force # 5. 安装 fzf 本体 winget install junegunn.fzf + +# 6. 安装 winget 命令未找到 提示工具 +Install-PSResource -Name Microsoft.WinGet.CommandNotFound ``` #### PowerShell 5.1 安装依赖 diff --git a/source/_posts/Windows软件安装.md b/source/_posts/Windows软件安装.md index 02cb7ae..25035d9 100644 --- a/source/_posts/Windows软件安装.md +++ b/source/_posts/Windows软件安装.md @@ -104,3 +104,33 @@ winget --proxy winget --no-proxy ``` +#### 使用代理 + +##### 命令行参数(单次使用) + +1. 开启配置(需要管理员权限) + +```powershell +winget settings --enable ProxyCommandLineOptions +``` + +2. 使用 + +```powershell +winget install Git.Git --proxy http://127.0.0.1:10809 +``` + +##### 管理员配置(全局生效) + +开启配置(需要管理员权限) + +```powershell +winget settings set DefaultProxy http://127.0.0.1:10809 +``` + +关闭配置(需要管理员权限) + +```powershell +winget settings reset DefaultProxy +``` +