-
Notifications
You must be signed in to change notification settings - Fork 211
Open
Labels
Status: Needs Investigationstatus:waiting-for-author-feedbackIssue that we've responded but needs author feedback to closeIssue that we've responded but needs author feedback to closetype:bugA broken experienceA broken experience
Description
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";

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

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_
Metadata
Metadata
Assignees
Labels
Status: Needs Investigationstatus:waiting-for-author-feedbackIssue that we've responded but needs author feedback to closeIssue that we've responded but needs author feedback to closetype:bugA broken experienceA broken experience