-
Notifications
You must be signed in to change notification settings - Fork 0
/
Import-Package.psm1
567 lines (504 loc) · 24.9 KB
/
Import-Package.psm1
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
# Initialize - Bootstraps the nuget type system
Write-Verbose "[Import-Package:Init] Initializing..."
$bootstrapper = & (Resolve-Path "$PSScriptRoot\src\bootstrapper\packaging.ps1")
$loaded = @{
"NuGet.Frameworks" = "netstandard2.0"
}
New-Item (Join-Path $PSScriptRoot "Packages") -Force -ItemType Directory
New-Item (Join-Path $PSScriptRoot "Natives") -Force -ItemType Directory
. "$PSScriptRoot\src\Resolve-CachedPackage.ps1"
. "$PSScriptRoot\src\Build-PackageData.ps1"
Write-Verbose "[Import-Package:Init] Initialized"
<#
.Synopsis
A simplistic cmdlet for getting the target framework of the current PowerShell session.
.Description
This cmdlet is used to get the target framework of the current PowerShell session.
It is used by Import-Package to determine which dlls to load from a NuGet package into the session.
.Example
Get-Dotnet # Example Return: Net,Version=v4.7.2
#>
function Get-Dotnet {
[CmdletBinding()]
param()
Process {
$bootstrapper.system
}
}
<#
.Synopsis
A simplistic cmdlet for getting the target runtime of the current PowerShell session.
.Description
This cmdlet is used to get the target runtime of the current PowerShell session.
It is used by Import-Package to determine which dlls to load from a NuGet package into the session.
.Example
Get-Runtime # Example Return: win10-x64
#>
function Get-Runtime {
[CmdletBinding()]
param()
Process {
$bootstrapper.runtime
}
}
<#
.Synopsis
Imports NuGet/Nupkg packages downloaded by PackageManagement
.Description
PackageManagement's default package providers (NuGet and PowerShellGet/Gallery)
lack the ability to load their NuGet Packs into PowerShell. While PowerShellGallery
Packages can be loaded with `Import-Module`, they import the packs using a module
manifest, not the actual nuspec. This module provides a `Import-Package` cmdlet for
importing packages by the nuspec instead of the module manifest.
By offering the commands `Import-Package` and `Import-Module` separately, this
module allows you to handle the C# dependencies (.nuspec) and PowerShell
dependencies (.psd1) from the same pack file on their own. This is useful for
dependency control. A couple of use cases for this feature:
- You want to rewrite an existing powershell module using the same C#
dependencies, but you want to provide a different PowerShell API.
- You are using multiple PowerShell modules that depend on the same C#
dependencies, and don't want to load the same C# dependencies multiple times.
- You want to inject your own C# dependencies into a PowerShell module.
.Parameter Name
The name of the package to import.
Alias: PackageName
ParameterSetName: Managed (default)
.Parameter Provider
The name of the PackageManagement Provider to use. Defaults to 'NuGet' as PowerShellGallery modules can already be imported with Import-Module.
Alias: ProviderName, PackageProvider
ParameterSetName: Managed (default)
.Parameter Version
The version of the package to import. Defaults to the latest version.
ParameterSetName: Managed (default)
.Parameter Package
The SoftwareIdentity object of the package to import (returned by Get-Package)
ParameterSetName: Managed-Object
.Parameter Path
The path to the .nupkg file to import.
Alias: PackagePath
ParameterSetName: Unmanaged
.Parameter TargetFramework
The target framework of the package to import. Defaults to TFM of the current PowerShell session.
.Parameter Offline
Skip downloading the package from the package provider.
.Parameter SkipDependencies
Skip automatic dependency handling.
.Parameter CachePath
The directory to place and load packages not provided by PackageManagement. These can be SemVer2 packages or packages provided with -Path
.Parameter NativePath
The directory to place and load native dlls from. Defaults to the current directory.
.Notes
You can set DIS_AUTOUPDATE_IMPORTS to 1 as an environment variable (or to $true as a global variable) to disable automatic update the Import-Package cmdlet's dependencies.
.Example
# These are the actual packages that make up the foundation of this module.
Import-Package -Package 'NuGet.Frameworks' -TargetFramework 'netstandard2.0'
Import-Package -Package 'NuGet.Packaging' -TargetFramework 'netstandard2.0'
#>
function Import-Package {
[CmdletBinding(DefaultParameterSetName='Managed')]
param(
# Gets .nupkg from PackageManagement by name
[Parameter(
Mandatory=$true,
ParameterSetName='Managed',
ValueFromPipeline=$true,
Position=0
)]
[Alias("PackageName")]
[string] $Name,
[Parameter(
ParameterSetName='Managed',
ValueFromPipeline=$true
)]
[string] $Version,
[Parameter(
ParameterSetName='Managed',
ValueFromPipeline=$true
)]
[Alias("ProviderName","PackageProvider")]
[string] $Provider = 'NuGet',
# Gets .nupkg from PackageManagement by the SoftwareIdentity object
[Parameter(
Mandatory=$true,
ParameterSetName='Managed-Object',
ValueFromPipeline=$true,
Position=0
)]
[Microsoft.PackageManagement.Packaging.SoftwareIdentity] $Package,
$TargetFramework = (Get-Dotnet),
# Gets .nupkg from the filesystem
[Parameter(
Mandatory=$true,
ParameterSetName='Unmanaged',
ValueFromPipeline=$true,
Position=0
)]
[Alias("PackagePath","Source")]
[string] $Path,
[switch] $SkipDependencies,
[switch] $Offline,
[string] $CachePath = "$PSScriptRoot\Packages",
[string] $NativePath
)
Process {
$PackageData = Switch( $PSCmdlet.ParameterSetName ){
"Managed-Object" {
Write-Verbose "[Import-Package:ParameterSet] Managed Object"
Build-PackageData -From "Object" -Options @( $Package, @{
"CachePath" = $CachePath
"NativePath" = $NativePath
"Offline" = $Offline
"SkipDependencies" = $SkipDependencies
}) -Bootstrapper $bootstrapper
}
"Managed" {
Write-Verbose "[Import-Package:ParameterSet] Managed"
Build-PackageData -From "Install" -Options @{
"CachePath" = $CachePath
"NativePath" = $NativePath
"Offline" = $Offline # If true, do not install
"SkipDependencies" = $SkipDependencies
"Name" = $Name
"Version" = $Version
} -Bootstrapper $bootstrapper
}
"Unmanaged" {
Write-Verbose "[Import-Package:ParameterSet] Unmanaged"
Build-PackageData -From "File" -Options @{
"CachePath" = $CachePath
"NativePath" = $NativePath
"Source" = $Path
"SkipDependencies" = $true
} -Bootstrapper $bootstrapper
}
}
If( $PackageData ){
Write-Verbose "[Import-Package:Preparation] Package $($PackageData.Name)$( If( $PackageData.Version ) { " $( $PackageData.Version ) successfully read"})"
} Else {
Write-Host "[Import-Package:Preparation] Package $($PackageData.Name) was skipped!"
}
Write-Verbose "[Import-Package:Framework-Handling] Selecting best available framework from package $($PackageData.Name)"
$TargetFramework = $TargetFramework -as [NuGet.Frameworks.NuGetFramework]
$TargetFramework = & {
If( $PackageData.Frameworks ){
$parsed_frameworks = $PackageData.Frameworks | ForEach-Object {
# $PackageData.Frameworks is in ShortFolderName (or TFM) format, it needs to be converted
[NuGet.Frameworks.NuGetFramework]::Parse( $_ )
}
$nearest_framework = Switch( $parsed_frameworks.Count ){
0 { $TargetFramework } # Fallback to the user provided one
1 {
$bootstrapper.Reducer.GetNearest( $TargetFramework, [NuGet.Frameworks.NuGetFramework[]]@( $parsed_frameworks ) )
}
default {
$bootstrapper.Reducer.GetNearest( $TargetFramework, [NuGet.Frameworks.NuGetFramework[]]$parsed_frameworks )
}
}
If( $nearest_framework ){
$nearest_framework
} Else {
$TargetFramework
}
} Elseif ( $PackageData.RID_Frameworks ){
$parsed_frameworks = $PackageData.RID_Frameworks | ForEach-Object {
# $PackageData.RID_Frameworks is in ShortFolderName (or TFM) format, it needs to be converted
[NuGet.Frameworks.NuGetFramework]::Parse( $_ )
}
$nearest_framework = Switch( $parsed_frameworks.Count ){
0 { $TargetFramework } # Fallback to the user provided one
1 {
$bootstrapper.Reducer.GetNearest( $TargetFramework, [NuGet.Frameworks.NuGetFramework[]]@( $parsed_frameworks ))
}
default {
$bootstrapper.Reducer.GetNearest( $TargetFramework, [NuGet.Frameworks.NuGetFramework[]]$parsed_frameworks )
}
}
If( $nearest_framework ){
$nearest_framework
} Else {
$TargetFramework
}
} Else {
# Fallback to the user provided one
$TargetFramework
}
}
$target_rid_framework = If( -not $PackageData.Frameworks ){
$TargetFramework
} Elseif ( $PackageData.RID_Frameworks ){
$parsed_frameworks = $PackageData.RID_Frameworks | ForEach-Object {
# $PackageData.RID_Frameworks is in ShortFolderName (or TFM) format, it needs to be converted
[NuGet.Frameworks.NuGetFramework]::Parse( $_ )
}
$nearest_framework = Switch( $parsed_frameworks.Count ){
0 { $TargetFramework } # Fallback to the user provided one
1 {
$bootstrapper.Reducer.GetNearest( $TargetFramework, [NuGet.Frameworks.NuGetFramework[]]@( $parsed_frameworks ) )
}
default {
$bootstrapper.Reducer.GetNearest( $TargetFramework, [NuGet.Frameworks.NuGetFramework[]]$parsed_frameworks )
}
}
If( $nearest_framework ){
$nearest_framework
} Else {
$TargetFramework
}
}
If( -not $target_rid_framework ){
$target_rid_framework = $TargetFramework
}
Write-Verbose "[Import-Package:Framework-Handling] Selected OS-agnostic framework $TargetFramework"
Write-Verbose "[Import-Package:Framework-Handling] Selected OS-specific framework $target_rid_framework"
If( $PackageData.Dependencies -and -not $PackageData.SkipDependencies ){
Write-Verbose "[Import-Package:Dependency-Handling] Loading dependencies for $( $PackageData.Name )"
If( $PackageData.Dependencies.Agnostic ){
$package_framework = $TargetFramework
$PackageData.Dependencies.Agnostic | ForEach-Object {
If( $loaded[ $_.Name ] ){
Write-Verbose "[Import-Package:Dependency-Handling] ($($PackageData.Name) Dependency) $($_.Name) already loaded"
} Else {
Write-Verbose "[Import-Package:Dependency-Handling] ($($PackageData.Name) Dependency) Loading $($_.Name) - $($_.Version) (Framework $( $package_framework.GetShortFolderName() ))"
If( $PackageData.Offline ){
Import-Package $_.Name -Version $_.Version -TargetFramework $package_framework -NativePath $PackageData.NativePath -Offline
} Else {
Import-Package $_.Name -Version $_.Version -TargetFramework $package_framework -NativePath $PackageData.NativePath
}
Write-Verbose "[Import-Package:Dependency-Handling] ($($PackageData.Name) Dependency) $($_.Name) Loaded"
}
}
}
If( $PackageData.Dependencies.ByFramework ){
$package_framework = & {
$parsed_frameworks = $PackageData.Dependencies.ByFramework.Keys -as [NuGet.Frameworks.NuGetFramework[]]
$selected_framework = $bootstrapper.Reducer.GetNearest( $TargetFramework, $parsed_frameworks )
$unparsed_selected_framework = $PackageData.Dependencies.ByFramework.Keys | Where-Object {
([NuGet.Frameworks.NuGetFramework] $_).ToString() -eq ($selected_framework).ToString()
}
$unparsed_selected_framework
}
$PackageData.Dependencies.ByFramework[ $package_framework ] | ForEach-Object {
If( $loaded[ $_.Name ] ){
Write-Verbose "[Import-Package:Dependency-Handling] ($($PackageData.Name) Dependency) $($_.Name) already loaded"
} Else {
Write-Verbose "[Import-Package:Dependency-Handling] ($($PackageData.Name) Dependency) Loading $($_.Name) - $($_.Version) (Framework $( ([NuGet.Frameworks.NuGetFramework]$package_framework).GetShortFolderName() ))"
If( $PackageData.Offline ){
Import-Package $_.Name -Version $_.Version -TargetFramework $package_framework -NativePath $PackageData.NativePath -Offline
} Else {
Import-Package $_.Name -Version $_.Version -TargetFramework $package_framework -NativePath $PackageData.NativePath
}
Write-Verbose "[Import-Package:Dependency-Handling] ($($PackageData.Name) Dependency) $($_.Name) Loaded"
}
}
}
} Elseif( $PackageData.Dependencies.Count ) {
Write-Warning "[Import-Package:Dependency-Handling] $($PackageData.Name) has $($PackageData.Dependencies.Count) dependencies, but either -Path or -SkipDependencies was used. Make sure to load the dependencies manually"
}
$dlls = @{
"lib" = [System.Collections.ArrayList]::new()
}
Write-Verbose "[Import-Package:Loading] Locating OS-agnostic dlls"
$short_folder_name = $TargetFramework.GetShortFolderName()
If( Test-Path "$(Split-Path $PackageData.Source)\lib" ){
Write-Verbose "[Import-Package:Loading] Locating OS-agnostic framework-agnostic dlls"
Try {
$agnostic_dlls = Resolve-Path "$(Split-Path $PackageData.Source)\lib\*.dll" -ErrorAction Stop
Switch( $agnostic_dlls.Count ){
0 {}
1 { $dlls.lib.Add( $agnostic_dlls ) | Out-Null }
default { $dlls.lib.AddRange( $agnostic_dlls ) | Out-Null }
}
Write-Verbose "[Import-Package:Loading] Found $( $dlls.lib.Count ) OS-agnostic framework-agnostic dlls"
} Catch {
Write-Verbose "[Import-Package:Loading] Unable to find OS-agnostic framework-agnostic dlls for $($PackageData.Name)"
}
If( Test-Path "$(Split-Path $PackageData.Source)\lib\$short_folder_name" ){
Write-Verbose "[Import-Package:Loading] Locating OS-agnostic dlls for $short_folder_name"
Try {
$framework_dlls = Resolve-Path "$(Split-Path $PackageData.Source)\lib\$short_folder_name\*.dll" -ErrorAction Stop
Switch( $framework_dlls.Count ){
0 {}
1 { $dlls.lib.Add( $framework_dlls ) | Out-Null }
default { $dlls.lib.AddRange( $framework_dlls ) | Out-Null }
}
Write-Verbose "[Import-Package:Loading] Found $( $dlls.lib.Count ) OS-agnostic dlls for $short_folder_name"
} Catch {
Write-Verbose "[Import-Package:Loading] Unable to find OS-agnostic dlls for $($PackageData.Name) for $short_folder_name"
}
}
}
Write-Verbose "[Import-Package:Loading] Locating OS-specific dlls"
$short_folder_name = $target_rid_framework.GetShortFolderName()
If( Test-Path "$(Split-Path $PackageData.Source)\runtimes\$( $PackageData.RID )" ){
$dlls.runtime = [System.Collections.ArrayList]::new()
Try {
$native_dlls = Resolve-Path "$(Split-Path $PackageData.Source)\runtimes\$( $PackageData.RID )\native\*.dll" -ErrorAction Stop
Switch( $native_dlls.Count ){
0 {}
1 { $dlls.runtime.Add( $native_dlls ) | Out-Null }
default { $dlls.runtime.AddRange( $native_dlls ) | Out-Null }
}
Write-Verbose "[Import-Package:Loading] Found $( $native_dlls.Count ) OS-specific native dlls"
} Catch {
Write-Verbose "[Import-Package:Loading] Unable to find OS-specific native dlls for $($PackageData.Name) on $($bootstrapper.runtime)"
}
If( Test-Path "$(Split-Path $PackageData.Source)\runtimes\$( $PackageData.RID )\lib\$short_folder_name" ){
Try {
$lib_dlls = Resolve-Path "$(Split-Path $PackageData.Source)\runtimes\$( $PackageData.RID )\lib\$short_folder_name\*.dll" -ErrorAction Stop
Switch( $lib_dlls.Count ){
0 {}
1 { $dlls.runtime.Add( $lib_dlls ) | Out-Null }
default { $dlls.runtime.AddRange( $lib_dlls ) | Out-Null }
}
Write-Verbose "[Import-Package:Loading] Found $( $lib_dlls.Count ) OS-specific managed dlls"
} Catch {
Write-Verbose "[Import-Package:Loading] Unable to find OS-specific managed dlls for $($PackageData.Name) on $($bootstrapper.runtime)"
}
}
}
If( -not $loaded[ $PackageData.Name ] ){
$loaded[ $PackageData.Name ] = @{}
}
$loaded[ $PackageData.Name ][ $PackageData.Version ] = @(
$PackageData.FullName,
$TargetFramework.GetShortFolderName(),
$target_rid_framework.GetShortFolderName()
)
if ( $dlls.lib -or $dlls.runtime ) {
if( $dlls.lib ){
$dlls.lib | ForEach-Object {
$dll = $_
Try {
Import-Module $_ -ErrorAction Stop
} Catch {
Write-Error "[Import-Package:Loading] Unable to load 'lib' dll ($($dll | Split-Path -Leaf)) for $($PackageData.Name)`n$($_.Exception.Message)`n"
If( $PackageData.SkipDependencies ){
Write-Host
Write-Host "[Import-Package:Loading] Package $($PackageData.Name) is marked for manual dependency loading (either -Path or -SkipDependencies were used)."
Write-Host "- Did you forget a dependency?" -ForegroundColor Yellow
}
$_.Exception.GetBaseException().LoaderExceptions | ForEach-Object { Write-Host $_.Message }
return
}
}
}
if( $dlls.runtime ){
$dlls.runtime | ForEach-Object {
$dll = $_
Try {
If( $bootstrapper.TestNative( $_.ToString() ) ){
Write-Verbose "[Import-Package:Loading] $_ is a native dll for $($PackageData.Name)"
Write-Verbose "- Moving to '$NativePath'"
$bootstrapper.LoadNative( $_.ToString(), $NativePath )
} Else {
Write-Verbose "[Import-Package:Loading] $_ is not native. It is, however, a OS-specific dll for $($PackageData.Name)"
Import-Module $_
}
} Catch {
Write-Error "[Import-Package:Loading] Unable to load 'runtime' dll ($($dll | Split-Path -Leaf)) for $($PackageData.Name) for $($bootstrapper.runtime)`n$($_.Exception.Message)`n"
If( $PackageData.SkipDependencies ){
Write-Host
Write-Host "[Import-Package:Loading] Package $($PackageData.Name) is marked for manual dependency loading (either -Path or -SkipDependencies were used)."
Write-Host "- Did you forget a dependency?" -ForegroundColor Yellow
}
return
}
}
}
} else {
Write-Warning "[Import-Package:Loading] $($PackageData.Name) is not needed for $( $bootstrapper.Runtime )`:$($TargetFramework.GetShortFolderName())"
}
}
}
<#
.Synopsis
Reads the nuspec of a NuGet/Nupkg package downloaded by PackageManagement
.Description
Provides a way to read the nuspec of a NuGet/Nupkg package downloaded by PackageManagement.
.Parameter Name
The name of the package to read.
Alias: PackageName
ParameterSetName: Managed (default)
.Parameter Provider
The name of the PackageManagement Provider to use. Defaults to 'NuGet' (consistent with Import-Package).
Alias: ProviderName, PackageProvider
ParameterSetName: Managed (default)
.Parameter Version
The version of the package to read. Defaults to the latest version.
.Parameter Package
The SoftwareIdentity object of the package to read (returned by Get-Package)
ParameterSetName: Managed-Object
.Parameter Path
The path to the .nupkg file to import.
Alias: PackagePath
ParameterSetName: Unmanaged
.Example
Read-Package -Package 'NuGet.Frameworks'
Read-Package -Package 'NuGet.Packaging'
#>
function Read-Package {
[CmdletBinding(DefaultParameterSetName='Managed')]
param(
# Gets .nupkg from PackageManagement by name
[Parameter(
Mandatory=$true,
ParameterSetName='Managed',
ValueFromPipeline=$true,
Position=0
)]
[Alias("PackageName")]
[string] $Name,
[Parameter(
ParameterSetName='Managed',
ValueFromPipeline=$true
)]
[string] $Version,
[Parameter(
ParameterSetName='Managed',
ValueFromPipeline=$true
)]
# Gets .nupkg from PackageManagement by the SoftwareIdentity object
[Alias("ProviderName","PackageProvider")]
[string] $Provider = 'NuGet',
[Parameter(
Mandatory=$true,
ParameterSetName='Managed-Object',
ValueFromPipeline=$true,
Position=0
)]
[Microsoft.PackageManagement.Packaging.SoftwareIdentity] $Package,
# Gets .nupkg from the filesystem
[Parameter(
Mandatory=$true,
ParameterSetName='Unmanaged',
ValueFromPipeline=$true,
Position=0
)]
[Alias("PackagePath")]
[string] $Path
)
Process {
$Path = if( $PSCmdlet.ParameterSetName -eq "Managed" ){
(Get-Package $Name -RequiredVersion $Version -ProviderName $Provider -ErrorAction Stop).Source
} elseif( $PSCmdlet.ParameterSetName -eq "Unmanaged" ){
$Path
} else {
$Package.Source
}
$bootstrapper.ReadNuspec( $Path )
}
}
If( ($bootstrapper.Runtime -match "^win") -and ($bootstrapper.System.Framework -eq ".NETCoreApp") ){
# Automatically fixes the missing WinRT functionality in PowerShell Core on Windows
If( ($global:DIS_AUTOUPDATE_IMPORTS -eq $true ) -or ( $env:DIS_AUTOUPDATE_IMPORTS -eq 1 ) ){
Import-Package "Microsoft.Windows.SDK.NET.Ref" -Offline
} Else {
Import-Package "Microsoft.Windows.SDK.NET.Ref"
}
}
Export-ModuleMember -Function @(
"Import-Package",
"Read-Package",
"Get-Dotnet",
"Get-Runtime"
)