-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlist-dependencies.ps1
25 lines (18 loc) · 1.37 KB
/
list-dependencies.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# This script makes it able to see all the references for each dll in a specified directory
# This can especially come in handy when you're getting a compile error message like : "Could not load file or assembly" which you know off you shouldn't be referencing it
# The line ". .\manage_csproj.ps1" will only work when you change your current working directory to the directory of the manage_csproj.ps1 file when executing from PowerShell ISE
# To do that just open the script in the powershell_ise and type cd YOURDISK:\YOURWORKSPACE\powershell-dotnet-tools in the command line
param(
[string] $ExcelExePath = "C:\Program Files (x86)\Microsoft Office\root\Office16\EXCEL.EXE",
[string] $BasePath = 'C:\tfs\Pricing\Dev\PricingFabric\Tests\Pricing.UnitTests\bin\x64\Debug',
[string] $OutFile = 'C:\temp\' + $BasePath.Replace("\","_").Replace(":","").Replace(" ","").ToLowerInvariant() + '_' +(get-date -format "yyyy-MM-dd_HH-mm-ss") + '.csv'
)
cd $PSScriptRoot
. .\file_functions.ps1
. .\manage_assembly.ps1
#get the content for the csv file
Get-ChildItem "$BasePath" -Name '*.dll' -Recurse |% { "$BasePath\$_" } |% { GetReferencedAssemblies -AssemblyFile "$_" } | Export-Csv "$OutFile"
#set the seperator of the csv file to make sure excel opens the text in multiple columns
"sep=," | Insert-Content $outfile
#open the excel file
&"$ExcelExePath" "$OutFile"