This should work from PowerShell:
$net4 = gci "C:\Windows\Microsoft.NET\Framework\v4.0.30319" | Where-Object {$_.Extension -eq ".dll"}
$net4 | ForEach-Object {
$_.name | Out-File "C:\Users\YourUser\AppData\Roaming\Microsoft\UProof\CUSTOM.DIC" -Append
}
You could either have it loop through all frameworks to be safe, or do it once for each .NET directory.
Also, if you want the filename without the extension (.dll) use $_.Basename
Update: Ran the script and it did work for me. I added the libraries this way, mscorlib for example.
I am also able to get methods:
$net4 = gci "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\" -Recurse -Force | Where-Object {$_.Extension -eq ".dll"}
$Methods
$net4 | ForEach-Object {
$Methods += $_ | Get-Member -Force -View All | Select -ExpandProperty Name
}
$Methods | Out-File "C:\Users\UserName\AppData\Roaming\Microsoft\UProof\CUSTOM.DIC" -Append
And it gets me (among lots, lots more):
OpenWrite
Refresh
Replace
SetAccessControl
set_Attributes
set_CreationTime
set_CreationTimeUtc
set_IsReadOnly
set_LastAccessTime
set_LastAccessTimeUtc
set_LastWriteTime
set_LastWriteTimeUtc
ToString
PSChildName
PSDrive
PSIsContainer
PSParentPath
PSPath
PSProvider
Attributes
Now the problem is there are many duplicates, but from here it should be simpler.
You could also use the C:\Windows\Microsoft.NET\Framework
directories instead of the GAC if you wish.
How are you manually doing this? – Austin T French – 2013-08-16T13:15:07.883
@AthomSfere - there's a couple of ways to "manually" add a single word such as typing it and right-click>add to dictionary or this answer
– Joel B – 2013-08-16T13:17:20.770@JoelB: Rather than right-clicking them individually it is easier to press F7 to show the spelling dialog and then for each one click Add to Dictionary (Alt + A). – James P – 2013-08-16T13:41:57.663
There are thousands of classes in the base system assemblies (system, mscorlib) but if you take into account other assemblies like system.web you get a huge number. Also don't forget that many method names will also cause the spell checker to complain. That is why I think it is easier to add the names manually using the method above. – James P – 2013-08-16T14:02:12.210
Another option: If you use a specific style(s) in your documents for .NET code you can disable spelling checking for it. (Google disable spell checking for code in Microsoft Word). – Brian – 2013-08-18T05:23:08.663