Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#3,413 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
powershell
Ambito
cli

Direzione di ricerca

Inizia riproducendo la differenza tra l'esecuzione delle assegnazioni fornite in uno script PowerShell 5.1 e sulla riga di comando, quindi importa microsoft.graph in entrambi i casi e confronta gli errori. Il problema è risolto quando l'importazione del modulo si comporta in modo coerente in entrambi i contesti oppure quando vengono documentati il limite e il workaround di PowerShell 5.1.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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_
Lingua principale
C#
Stelle
902
Fork
233
Merge medio
1g 3h
PR unite (30g)
24

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoftgraph/msgraph-sdk-powershell

Tutte le issue di microsoftgraph/msgraph-sdk-powershell

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.