0

I'm administering a Sharepoint Online site right now. Is there a way to run Sharepoint powershell cmdlets externally from SPFX/ NodeJS. I'm trying to create a UI for disabling versioning for a document library. Seems that disabling versioning could only be achieved through powershell right now.

(Or is there an sharepoint api endpoint for actually doing it, not sure)

Hope Estheim
  • 11
  • 1
  • 3

1 Answers1

0

You cannot run powershell cmdlets from SPFx. SPFx is a framework to build applications that run in a browser.

But you can use REST API (the easiest way to use it is probably pnpjs to wrap it). You could try something like this (just update the library property):

await sp.web.lists.getByTitle("Documents").update({ EnableVersioning: false });
Nikolay
  • 10,752
  • 2
  • 23
  • 51