已添加仓库: bitnami 已添加仓库: ingress-nginx 已添加仓库: jetstack Hang tight while we grab the latest from your chart repositories... ...Successfully got an update from the "bitnami" chart repository ...Successfully got an update from the "ingress-nginx" chart repository ...Successfully got an update from the "jetstack" chart repository Update Complete.
name version app_version description ---- ------- ----------- ----------- bitnami/nginx 18.2.5 1.25.4 NGINX Open Source... ingress-nginx/ingress-nginx 4.11.3 1.11.3 Ingress controller...
部署: api-gateway -> production Release "api-gateway" has been upgraded. Happy Helming! NAME: api-gateway LAST DEPLOYED: Wed Apr 23 10:30:00 2026
部署: auth-service -> production Release "auth-service" has been upgraded. Happy Helming! NAME: auth-service LAST DEPLOYED: Wed Apr 23 10:30:45 2026
部署: frontend -> production Release "frontend" has been upgraded. Happy Helming!
===== 部署报告 ===== Name Namespace Status Duration ---- --------- ------ -------- api-gateway production deployed 32.5s auth-service production deployed 41.2s frontend production deployed 3.1s
===== 当前 Release 状态 ===== name namespace chart chart_version status updated ---- --------- ----- ------------- ------ ------- api-gateway production nginx 18.2.5 deployed 2026-04-23 10:30:00 auth-service production auth-service 1.5.0 deployed 2026-04-23 10:30:45 frontend production frontend 2.1.0 deployed 2026-04-23 10:31:02 报告已导出到 CSV 文件
PowerShell 模块生态在过去几年里蓬勃发展,PowerShell Gallery 上已经托管了数以万计的模块。从日常运维的 Active Directory 管理,到云端自动化的 Az 模块,再到新兴的 AI 交互工具,几乎每种场景都有对应的模块可用。然而,模块数量的增长也带来了管理上的挑战:不同项目依赖同一个模块的不同版本、私有环境的离线分发需求、以及供应链安全对模块来源的审计要求,都是实际工作中必须面对的问题。
# 示例:搜索 VS Code Find-WinGetPackage-Keyword"Visual Studio Code"
# 示例:安装 VS Code(静默模式) Install-WinGetPackage-PackageId'Microsoft.VisualStudioCode'-Silent
# 示例:查看已安装的软件列表 Get-WinGetInstalled
执行结果示例:
1 2 3 4 5 6 7 8 9 10 11 12 13
名称 ID 版本 来源 --------------------------------------------------------------------------- Visual Studio Code Microsoft.VisualStudioCode 1.96.2 winget Visual Studio Code Insiders Microsoft.VisualStudioCode.Insiders 1.97.0 winget
正在安装: Microsoft.VisualStudioCode 已成功完成安装
名称 ID 版本 --------------------------------------------------------------------------- Visual Studio Code Microsoft.VisualStudioCode 1.96.2 Git for Windows Git.Git 2.47.1 PowerShell 7 Microsoft.PowerShell 7.4.6
计划任务兼容性:Register-ScheduledTask 需要 Windows 8.1 及以上系统。在 Windows Server 环境中,需要确认 Task Scheduler 服务正常运行,且执行账户具有安装软件的权限。对于不支持计划任务的场景,可以考虑使用 Group Policy 的启动脚本替代。
模块名: Carbon, 版本: 2.5.0, 描述: Carbon is a PowerShell module for automating the configuration of Windows. 模块名: ACMESharp, 版本: 0.8.1, 描述: Client library for the ACME protocol for certificate management. 模块名: DSInternals, 版本: 2.22, 描述: The DSInternals PowerShell Module exposes several internal features of Active Directory. 模块名: DSCEA, 版本: 1.2.0.0, 描述: DSCEA is a scanning engine for processing Test-DscConfiguration results. 模块名: PoshACME, 版本: 3.10.0, 描述: PowerShell module for ACME certificate management.
在 Windows 上管理软件安装是运维工作中最繁琐的环节之一——每台服务器需要安装几十个工具和运行时,手动安装耗时且容易遗漏版本不一致。Windows Package Manager(winget)和 Chocolatey 的出现改变了这一局面,它们让 Windows 也拥有了类似 Linux apt-get / yum 的包管理体验。结合 PowerShell,可以实现软件的批量安装、版本锁定和自动更新。
Name Version Description ---------------------- Az 12.0.0 Microsoft Azure PowerShell Az.Compute 7.0.0 Microsoft Azure PowerShell - Compute ... AzureAD 2.0.2. Azure Active Directory V2 PowerShell...
Name Version Repository --------------------- Az.Compute 7.0.0 PSGallery Pester 5.5.0 PSGallery
Name Version InstalledLocation ----------------------------- Az 11.3.0 C:\Users\admin\Documents\PowerShell\Modules\Az\11.3.0 Az 12.0.0 C:\Users\admin\Documents\PowerShell\Modules\Az\12.0.0
Version Description ------------------ 5.5.0 Pester provides a framework for running BDD style tests... 5.4.1 Pester provides a framework for running BDD style tests... 5.4.0 Pester provides a framework for running BDD style tests...
已更新:Pester 已更新:PSScriptAnalyzer 更新失败:Az - Module 'Az' is already at the latest version
上面的代码定义了三个核心函数:Get-WinGetPackage 解析 winget list 的纯文本输出为结构化对象,Install-WinGetPackage 封装安装命令并自动接受协议,Update-WinGetPackage 封装升级命令。每个函数都支持 ShouldProcess,可以通过 -WhatIf 参数进行干运行预览。
1 2 3 4 5 6 7
Name Id Version ---- -- ------- PowerShell Microsoft.PowerShell 7.4.6 Visual Studio Code Microsoft.VisualStudioCode 1.96.2 Windows Terminal Microsoft.WindowsTerminal 1.21.3231 Git Git.Git 2.47.1 7-Zip 7zip.7zip 24.08