Forum Discussion
Rob Ellis
Jun 07, 2017Bronze Contributor
Task list - setting EnableAssignToEmail using PnP powershell - not working consistently
Using the following powershell: $csvFile = ".\SiteIDs.csv"
$sites = Import-Csv $csvfile
Connect-SPOnline -Url https://<tenantname>.sharepoint.com -Credentials <creds>
foreach ($site in $site...
- Jun 07, 2017
Try the below script.
$csvFile = ".\SiteIDs.csv" $sites = Import-Csv $csvfile $cred=Get-Credential foreach ($site in $sites) { Connect-PnPOnline -Url $site.URl -Credentials $cred $ctx=Get-PnPContext $List = Get-PnPList -Identity Tasks $list.EnableAssignToEmail = $true $list.Update() $ctx.load($list) $ctx.executeQuery() }
Richard Bourke
Jun 07, 2017Iron Contributor
This line is using $List (with capital L), the other lines are using $list (lowercase):
$List = Get-PnPList -Web $web -Identity Tasks
Rob Ellis
Jun 07, 2017Bronze Contributor
ok - so I corrected that, and re-ran - same problem.
(I wasn't aware that variable names were case sensitive in PoSh - I know some other things are though)
Thanks anyway.
(I wasn't aware that variable names were case sensitive in PoSh - I know some other things are though)
Thanks anyway.