
Hi @ネパリ サンデャ ,
Please try this script:
#Config Variables
$SiteURL = "https://tenant.sharepoint.com/sites/amy12345"
$filePath = "C:\Users\spadmin\Desktop\pnp.csv"
#Get the CSV file
$csv = Import-CSV $filePath
#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL -Interactive
ForEach($row in $csv)
{
Write-host -f Yellow "Creating Document Library:"$row.library
New-PnPList -Title $row.library -Template DocumentLibrary -ErrorAction Stop
Set-PnPList -Identity $row.library -CopyRoleAssignments:$False -BreakRoleInheritance -ListExperience NewExperience
}
ForEach($row in $csv) {
Set-PnPListPermission -Identity $row.library -AddRole $row.permission -User $row.user
}
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.