02 May 2012

Enable-SPFeature: The Feature is not a Farm Level Feature and is not found in a Site level defined by the Url

After running the following command

Enable-SPFeature-Identity DocumentSet-URL http://url

I received the following error

Enable-SPFeature: The Feature is not a Farm Level Feature and is not found in a Site level defined by the Url ...

Why ???

It happened to me because I copied some files at the time manually (not using the solution).
The team system locks the files to ReadOnly.
And the command fails (the readonly found only a deep excavation in the log files of sharepoint)



The solution: Disables the ReadOnly for all the files in sub folders.
It can be found here:

Uncheck read only file for all sub folder with PowerShell

I use this code at 14\Template folder
Thanks,
Roi

4 comments:

venkatx5 said...

Thanks for the fix. It worked. But the Remove Read Only powershell script has issue.

Roi kolbinger said...

I fixed the readonly script

Anonymous said...

Can you Post the readoly script please?

Roi kolbinger said...

the readonly script

$Path = "your root folder"
$Files = Get-ChildItem $Path -Recurse
ForEach ($File in $Files)
{
Write-Host "File: " $File "IsReadOnly: " $File.IsReadOnly
if ($File.Attributes -ne "Directory" -and $File.Attributes -ne "Directory, Archive")
{
if ($File.IsReadOnly -eq $true )
{
try
{
Set-ItemProperty -path $File.FullName -name IsReadOnly -value $false
write-host "file:" $File.FullName "is now false read only" -foregroundcolor "magenta"
}
catch [Exception]
{
Write-Host "Error at file " $Path "\" $File
Write-Host $_.Exception.Message
}
}
}
}

Post a Comment