diff --git a/scripts/Common/Software/PowerShell/Module.ps1 b/scripts/Common/Software/PowerShell/Module.ps1 index 32292f07..cc810429 100644 --- a/scripts/Common/Software/PowerShell/Module.ps1 +++ b/scripts/Common/Software/PowerShell/Module.ps1 @@ -9,11 +9,18 @@ $null = New-Module { .PARAMETER Name The name of the module to install. + + .PARAMETER NativeOnly + A value indicating whether the module is installed in Windows PowerShell only. + + .PARAMETER NoProfile + A value indicating whether the module is not added to the profile script of users. #> function Get-ModuleInstallerComponents { param( [string] $Name, - [switch] $NativeOnly + [switch] $NativeOnly, + [switch] $NoProfile ) @{ @@ -47,12 +54,14 @@ $null = New-Module { [hashtable] $Arguments ) - $name = $Arguments.Name; + if (-not $NoProfile) { + $name = $Arguments.Name; - Add-PowerShellProfileStatement ` - -DefaultUser ` - -Category $name ` - -Script "Import-Module `"$name`";"; + Add-PowerShellProfileStatement ` + -DefaultUser ` + -Category $name ` + -Script "Import-Module `"$name`";"; + } }; } }