Example of code analysis from StudioShell.Provider

### check-code.ps1 ###

# Run this in the Package Manager Console first – a solution must be open.
#Install-Package StudioShell.Provider

#The following should be run in the Package Manager Console in the form . pathtofilecheck-code.ps1 | out-gridview

#This is a great way of finding code entities where the filename does not match the elements name.

dir dte:/solution/codemodel -recurse | where Kind -Match ‘vs.*(Class|Enum|Interface)’ |select PSPath, Fullname, Name, Kind | % {

$toMatch = “$($_.Name).cs”;
if ($_.PSPath -NotMatch $toMatch) {
return $_
}
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s