I’d like to be able to update some files propreties via Powershell, so here the script I tried:
[System.Array]$ Words = 'Project Overview','Project from pervious Years' foreach($ folder in $ list.RootFolder.SubFolders) { if ($ folder.Name -ne "Reports") { foreach($ file in $ folder.Files) if ($ Words –contains $ file.Name) { $ file.CheckOut(); $ file.Properties['Status'] = "9. Old" $ file.Properties.Update(); $ file.CheckIn('Test'); } } } }
the files I want to modify are stored in my Reports folder, so once I’m in this folder I loop all files until I find a files whose the name is included in my array, I update the files and then I continue I don’t know why but my code doesn’t work and as it’s the first I tried to do something via powershell, maybe something is wrong in my code Thank you