C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Powershell Script to Find SharePoint Web Scoped Features
WhatsApp
Karthik Muthu Karuppan
Jan 27
2015
970
0
0
FindWebScopedFeature
$LogTime = Get-Date -Format yyyy-MM-dd_hh-mm
$LogFile =
".\WebScopedFeaturePatch-$LogTime.rtf"
# Add SharePoint PowerShell Snapin
if
( (Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $
null
) {
Add-PSSnapin Microsoft.SharePoint.Powershell
}
$scriptBase = split-path $SCRIPT:MyInvocation.MyCommand.Path -parent
Set-Location $scriptBase
#Deleting any .rtf files in the scriptbase location
$FindRTFFile = Get-ChildItem $scriptBase\*.* -include *.rtf
if
($FindRTFFile)
{
foreach($file
in
$FindRTFFile)
{
remove-item $file
}
}
start-transcript $logfile
try
{
Write-Verbose
"Getting features at the Web Scope ..."
$features = Get-SPFeature -Limit All | Where-Object {$_.Scope -eq
"WEB"
} | Sort-Object DisplayName
Write-Output $features
}
catch
[Exception] {
Write-Error $Error[0]
$err = $_.Exception
while
( $err.InnerException ) {
$err = $err.InnerException
Write-Output $err.Message
}
}
SharePoint
SharePoint farm
Up Next
Powershell Script to Find SharePoint Web Scoped Features