You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

以SYSTEM身份运行directory-treesize.ps1时遇ArgumentOutOfRangeException错误

SYSTEM用户运行directory-treesize.ps1脚本报错问题

执行详情

  • 脚本:directory-treesize.ps1
  • 执行身份:SYSTEM用户
  • 运行命令:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -file "C:\scripts\directory-treesize.ps1" -depth 5 -directory "D:\"
-minSizeGB 30 -notree -noColor -logFile "c:\scripts\details.txt"

错误信息

  • [dotNet]::Start($directory, $minSizeGB, $depth, [bool]$showFiles, ...
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : ArgumentOutOfRangeException

补充说明

  • 普通用户身份运行该脚本无异常
  • 脚本在Windows 10、Server 2012 R2系统上运行正常,仅在Server 2022上失败
  • PowerShell 5.1及PowerShell 7版本均出现相同错误

内容的提问来源于stack exchange,提问作者Alex Lum

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.22 11:07:01