Allow installing modules native only
This commit is contained in:
parent
962f216a52
commit
9786d53ae5
|
@ -11,12 +11,14 @@ $null = New-Module {
|
|||
#>
|
||||
function Get-ModuleInstallerComponents {
|
||||
param(
|
||||
[string] $Name
|
||||
[string] $Name,
|
||||
[switch] $NativeOnly
|
||||
)
|
||||
|
||||
@{
|
||||
arguments = @{
|
||||
name = $Name;
|
||||
nativeOnly = $NativeOnly;
|
||||
};
|
||||
installer = {
|
||||
param(
|
||||
|
@ -26,7 +28,10 @@ $null = New-Module {
|
|||
|
||||
$env:PENDING_MODULE_NAME = $Arguments.Name;
|
||||
$installAction = { Install-Module -Scope AllUsers -Force $env:PENDING_MODULE_NAME @args };
|
||||
& $installAction -AcceptLicense;
|
||||
|
||||
if (-not $Arguments.NativeOnly) {
|
||||
& $installAction -AcceptLicense;
|
||||
}
|
||||
|
||||
if (Test-Command powershell) {
|
||||
powershell -c ($installAction.ToString());
|
||||
|
|
Loading…
Reference in a new issue