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

Set-PnPListItem with an apostrophe / single quote in the name when using the -Batch parameter fails

Aperta
#5,479 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp, powershell
Ambito
api, backend

Direzione di ricerca

Start from the Set-PnPListItem entry point and trace the -Batch path that builds the list-title request. Reproduce the issue with a list named "name with 'apostrophe" and compare batched and non-batched calls; done means the batched call succeeds without requiring callers to pre-escape the apostrophe.

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

Descrizione

bug
Reporting an Issue

When calling Set-PnPListItem -List $name -Batch $BATCH when $name has a single quote / apostrophe in the command fails.

The call works if the -Batch parameter is not provided or the single quote is escaped before calling, eg. using $name.replace("'", "''")

Expected behavior

The apostrophe should be escaped and the call should succeed and be batched.

Actual behavior

The apostrophe isn't escaped and the name passed to the underlying framework is invalid.

Steps to reproduce behavior

Establish a connection to a site with a list that has an apostrophe in the name and start a batch with
$BATCH = New-PnPBatch
Try and set the values of an item on that list
$Values = @{}
Set-PnPListItem -List "name with 'apostrophe" -Identity <item id> -Values $values -Batch $BATCH

This should produce the error

The expression "web/lists/getbytitle('name with 'aprostophe')" is not valid.

What is the version of the Cmdlet module you are running?

Issue exists in both versions.
Manifest 3.4.40 nightly
Manifest 3.4.30 nightly

Which operating system/environment are you running PnP PowerShell on?
  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify
Lingua principale
C#
Stelle
905
Fork
409
Merge medio
2g 9h
PR unite (30g)
10

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

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 pnp/powershell

Tutte le issue di pnp/powershell

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.