Hi All,
I have made these days some deployments and I wanted test all my source code in one way. Making script in PowerShell is my outcome. Script contains recursive getting files with “.dll” extension, yes I can do the same with extension “.wsp” and unzip package and I decided it might be as simple as possible. Later on, it creates folder in your current location and all output are written there.
Have a look
function global:Get-SPDisposeCheck
{
Write-Host “Recursive check current location …”
$path = $PWD.Path
#checking actual location recursively
$Dir = get-childitem $path -recurse
#all files with dll extension
$List = $Dir | where {$_.extension -eq“.dll” }
#made new folder for results
$export = $path+ “\” + “SPCheck_$((get-date).toString(‘yyyyMMdd-hhmmss’))”
$dir = md $export
#on every file execute SPDisposeCheck
$List | ForEach-Object {
Write-Host$_.Name “is beeing checked…”
$report = $export + “\” + $_.Name + “.spdisposecheck.txt”
#in some point, you can use the same dll files, it will be overridden
& “C:\Program Files (x86)\Microsoft\SharePoint Dispose Check\SPDisposeCheck.exe”$_.fullname | Out-File $report -Force }
#open result folder to review
explorer $export
}
Execute in PowerShell and see output:

Happy SharePointing guys
Like this:
Like Loading...