Allow installing modules native only
This commit is contained in:
parent
d0aed26865
commit
a8929f0707
1 changed files with 7 additions and 2 deletions
|
@ -12,12 +12,14 @@ $null = New-Module {
|
||||||
#>
|
#>
|
||||||
function Get-ModuleInstallerComponents {
|
function Get-ModuleInstallerComponents {
|
||||||
param(
|
param(
|
||||||
[string] $Name
|
[string] $Name,
|
||||||
|
[switch] $NativeOnly
|
||||||
)
|
)
|
||||||
|
|
||||||
@{
|
@{
|
||||||
arguments = @{
|
arguments = @{
|
||||||
name = $Name;
|
name = $Name;
|
||||||
|
nativeOnly = $NativeOnly;
|
||||||
};
|
};
|
||||||
installer = {
|
installer = {
|
||||||
param(
|
param(
|
||||||
|
@ -27,7 +29,10 @@ $null = New-Module {
|
||||||
|
|
||||||
$env:PENDING_MODULE_NAME = $Arguments.Name;
|
$env:PENDING_MODULE_NAME = $Arguments.Name;
|
||||||
$installAction = { Install-Module -Scope AllUsers -Force $env:PENDING_MODULE_NAME @args };
|
$installAction = { Install-Module -Scope AllUsers -Force $env:PENDING_MODULE_NAME @args };
|
||||||
& $installAction -AcceptLicense;
|
|
||||||
|
if (-not $Arguments.NativeOnly) {
|
||||||
|
& $installAction -AcceptLicense;
|
||||||
|
}
|
||||||
|
|
||||||
if (Test-Command powershell) {
|
if (Test-Command powershell) {
|
||||||
powershell -c ($installAction.ToString());
|
powershell -c ($installAction.ToString());
|
||||||
|
|
Loading…
Reference in a new issue