Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

import-module with $MaximumFunctionCount = 32768 fails in PowerShell 5.1

未关闭
#3,413 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
powershell
领域
cli

调研方向

首先,重现分别在 PowerShell 5.1 脚本中和命令行中运行所提供赋值时的差异,然后在两种情况下都导入 microsoft.graph 并比较错误。当模块导入在两种上下文中的行为一致,或者记录了 PowerShell 5.1 的限制和解决方法时,该问题即得到解决。

由索引模型根据 Issue 内容生成。

描述

Status: Needs Investigation type:bug
Describe the bug

import-module microsoft.graph with $MaximumFunctionCount = 32768 fails in PowerShell 5.1 when the variable is set in the script, but works fine if it is done on the command line.

##
## Setting in script
##

if ( 32768 -gt $MaximumVariableCount ) {

    $MaximumVariableCount = 32768;

};

if ( 32768 -gt $MaximumFunctionCount ) {

    $MaximumFunctionCount = 32768;

};

"MaximumVariableCount $MaximumVariableCount ";
"MaximumFunctionCount $MaximumFunctionCount";

Image

Script display unfortunately with error messages in Norwegian. But you get the drift.

Image

BTW. I know this works fine in PowerShell 7.x, but those who run this might not have that installed.

Expected behavior

That import-module works the same whether it is a script or on command line in PowerShell 5.1.

How to reproduce

Run script or copy commands from script to command line.

SDK Version

No response

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output
Click to expand log ```
</details>


### Configuration

_No response_

### Other information

_No response_
主要语言
C#
星标
902
派生
233
平均合并
1 天 22 小时
30 天内合并 PR
29

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoftgraph/msgraph-sdk-powershell 的其他 Issue

查看 microsoftgraph/msgraph-sdk-powershell 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。