Hi @gogi100
You could try below code:
Add-PSSnapin Microsoft.SharePoint.PowerShell -EA SilentlyContinue
$Web = Get-SPWeb "http://test-net.dri.local"
$list = $web.Lists["luyidoc"]
$items = $list.Items
foreach($folder in $list.Folders)
{
$imeiprezime=$folder["luyi"]
$eposta=$folder["luyi2"]
$query = New-Object -Type 'Microsoft.SharePoint.SPQuery'
$query.Folder = $folder.Folder
$folderItems = $list.GetItems($query)
foreach($item in $folderItems)
{
if($item["luyi"] -eq $null)
{
$item["luyi"] = $imeiprezime
$item.Update()
}
if($item["luyi2"] -eq $null)
{
$item["luyi2"] = $eposta
$item.Update()
}
}
}
Here you need to change the parameter as your own need.
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.