From a8929f070774927efa3da7ef8380a1cd5ff1ceb4 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 8 Aug 2024 02:28:23 +0200 Subject: [PATCH] Allow installing modules native only --- scripts/Common/Software/PowerShell/Module.ps1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/Common/Software/PowerShell/Module.ps1 b/scripts/Common/Software/PowerShell/Module.ps1 index fe2a9e45..32292f07 100644 --- a/scripts/Common/Software/PowerShell/Module.ps1 +++ b/scripts/Common/Software/PowerShell/Module.ps1 @@ -12,12 +12,14 @@ $null = New-Module { #> function Get-ModuleInstallerComponents { param( - [string] $Name + [string] $Name, + [switch] $NativeOnly ) @{ arguments = @{ name = $Name; + nativeOnly = $NativeOnly; }; installer = { param( @@ -27,7 +29,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());