报告:微软 Win11 默认预装应用约占 1.6GB 磁盘空间

报告:微软 Win11 默认预装应用约占 1.6GB 磁盘空间
文章摘要:与许多操作系统一样,微软也在其 Windows 11、Windows 10 和其他产品中提供了一堆默认应用。Oofhours 的一份新报告就揭开了 Wind

  与许多操作系统一样,微软也在其 Windows 11、Windows 10 和其他产品中提供了一堆默认应用。Oofhours 的一份新报告就揭开了 Windows 11 中的默认应用有多大。

  如下图所示,使用 PowerShell 提供的查询功能,我们能够计算出 Windows 11 默认应用的大小。这些应用已按大小(以字节为单位)降序排序,可以看到 Microsoft Teams 是最大的应用,占用了大约 91MB 的空间。

  然而,该查询只是指向了 XML 文件位置,而部分应用有另一个文件夹,需要额外计算大小。比如 Microsoft Store Purchase 显示大小为 11KB,但实际大小为 37MB。

  对列出的每一个应用进行检查后发现,Windows 11 的默认预装应用大小约为 1.6GB,IT之家小伙伴觉得多不多?

  以下是在 PowerShell 中查看所有 Windows 应用大小的脚本,包括默认应用和从 Microsoft Store 下载的应用(需要先取消隐藏 WindowsApps 文件夹):

  Get-AppxProvisionedPackage -online | % {

  # Get the main package location using the manifest

  $loc = Split-Path ( [Environment]::ExpandEnvironmentVariables($_.InstallLocation) ) -Parent

  If ((Split-Path $loc -Leaf) -ieq 'AppxMetadata') {

  $loc = Split-Path $loc -Parent

  }

  # Get a pattern for finding related folders

  $matching = Join-Path -Path (Split-Path $loc -Parent) -ChildPath "$($_.DisplayName)*"

  $size = (Get-ChildItem $matching -Recurse -ErrorAction Ignore | Measure-Object -Property Length -Sum).Sum

  # Add the results to the output

  $_ | Add-Member -NotePropertyName Size -NotePropertyValue $size

  $_ | Add-Member -NotePropertyName InstallFolder -NotePropertyValue $loc

  $_

  } | Select DisplayName, PackageName, Version, InstallFolder, Size

本站尊重版权,转载目的在于传递更多信息,若内容侵犯您的权益,请及时联系我们,本站将及时处理。

扫一扫,分享到微信

猜你喜欢

微信公众号

微信公众号