CSOM PowerShell change title of a list, add ad groups assign permission

Iron Contributor

Hi,

 

I was trying to put together a powershell script  however i ahave couple of queries :

 

how do i change title of a list, add ad groups assign permission to a list.

How do i achieve this in CSOM powershell in SP online

 

Could you please help me with an example

5 Replies

HI @null null,

 

You want to use PnP-PowerShell for this.

 

 

Thewn the following command will do the job:

 

Set-PnPList -Identity "OldList" -Title "NewList"

How do i package the script for the pnp cmdlets.

 

thanks 

Could you explain a bit further please? what do you mean with packaging PowerShell scripts?

If i forward this script to the end user, the user needs to download the pnp cmdlets - which i want to avoid this additional steps.

 

thanks

You could take a copy of the module folder after you have installed it yourself and get the users to place it next to the script in a folder called Modules.

 

Then within the script set $env:PSModulePath to include the location of the modules folder:

 

 

$path = Split-Path -parent $MyInvocation.MyCommand.Definition
if ($env:PSModulePath -notlike "*$path\Modules")
{
"Adding ;$path\Modules to PSModulePath" | Write-Debug
$env:PSModulePath += ";$path\Modules"
}