FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
PowerShell/src/TypeCatalogParser/Main.cs at master · ChiangFamily/PowerShell · GitHub
ChiangFamily
/
PowerShell
Public
forked from
PowerShell/PowerShell
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
PowerShell
/
src
/
TypeCatalogParser
/
Main.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
42 lines (37 loc) · 1.87 KB
Breadcrumbs
PowerShell
/
src
/
TypeCatalogParser
/
Main.cs
Copy path
File metadata and controls
42 lines (37 loc) · 1.87 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using
System
;
using
System
.
IO
;
using
System
.
Linq
;
using
NuGet
.
Frameworks
;
using
Microsoft
.
DotNet
.
Cli
.
Utils
;
using
Microsoft
.
DotNet
.
ProjectModel
;
using
Microsoft
.
DotNet
.
ProjectModel
.
Graph
;
using
Microsoft
.
Extensions
.
DependencyModel
.
Resolution
;
namespace
TypeCatalogParser
{
public
class
Program
{
public
static
void
Main
(
string
[
]
args
)
{
// These are packages that are not part of .NET Core and must be excluded
string
[
]
excludedPackages
=
{
"Microsoft.Management.Infrastructure"
,
"Microsoft.Management.Infrastructure.Native"
,
"Microsoft.mshtml"
}
;
// The TypeCatalogGen project takes this as input
var
outputPath
=
"../TypeCatalogGen/powershell.inc"
;
// Get a context for our top level project
var
context
=
ProjectContext
.
Create
(
"../Microsoft.PowerShell.SDK"
,
NuGetFramework
.
Parse
(
"netstandard1.6"
)
)
;
System
.
IO
.
File
.
WriteAllLines
(
outputPath
,
// Get the target for the current runtime
from
t
in
context
.
LockFile
.
Targets
where
t
.
RuntimeIdentifier
==
context
.
RuntimeIdentifier
// Get the packages (not projects)
from
x
in
t
.
Libraries
where
(
x
.
Type
==
"package"
&&
!
excludedPackages
.
Contains
(
x
.
Name
)
)
// Get the real reference assemblies
from
y
in
x
.
CompileTimeAssemblies
where
y
.
Path
.
EndsWith
(
".dll"
)
// Construct the path to the assemblies
select
$
"
{
context
.
PackagesDirectory
}
/
{
x
.
Name
}
/
{
x
.
Version
}
/
{
y
.
Path
}
;"
)
;
Console
.
WriteLine
(
$
"List of reference assemblies written to
{
outputPath
}
"
)
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL