0

How do I set a metadata (say CustomerID or Skills) with PowerShell? I am trying to fill CustID. Edited. This is the working version of the final powershell code.

Here is the working code....

$siteURL="http://Server"
$docLib = "My Doc Lib"
$site=Get-SPSite $siteURL
$web=$site.RootWeb
$collFiles=$web.GetFolder($docLib).Files
$count=$collFiles.Count
while($count -ne 0)
{
$item = $collFiles[$count-1].Item
$DocSet = $item["Region"]
Write-Host "$DocSet is the doc set. $collFiles[$count-1].Name is name"
$collFiles[$count-1].MoveTo($siteURL + "/" + $docLib + "/" + $DocSet + "/"  + $collFiles[$count-1].Name, $true)                       
$count--
}
0

Here is the working code....

$siteURL="http://Server"
$docLib = "My Doc Lib" 
$site=Get-SPSite $siteURL 
$web=$site.RootWeb 
$collFiles=$web.GetFolder($docLib).Files 
$count=$collFiles.Count 

while($count -ne 0) 
{
 $item = $collFiles[$count-1].Item 
 $DocSet = $item["Region"]
 Write-Host "$DocSet is the doc set. $collFiles[$count-1].Name is name"
 $collFiles[$count-1].MoveTo($siteURL + "/" + $docLib + "/" + $DocSet + "/"  + $collFiles[$count-1].Name, $true)                       
$count-- 
} 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.