Hi @Alexandre
You can run following script to rename the files in sharepoint
Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/sitename -Credentials (Get-Credential)
$listitems = Get-PnPListItem -List "Your list name"
foreach ($item in $listitems) {
Write-Output "Processing item $($item.ID)"
$item["Title"] = $item["FileLeafRef"]
$item["FileLeafRef"] = $item["Code"]
$item.Update()
}
Invoke-PnPQuery
Disconnect-PnPOnline
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.