From f39b662819db8b53eb72dfa0bbf6f8d8538f0dce Mon Sep 17 00:00:00 2001 From: iSazonov Date: Wed, 3 Oct 2018 14:59:58 +0500 Subject: [PATCH] Use params in ImportPSModule --- .../engine/InitialSessionState.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/System.Management.Automation/engine/InitialSessionState.cs b/src/System.Management.Automation/engine/InitialSessionState.cs index 701d9f0a856..8c4cc0d0e21 100644 --- a/src/System.Management.Automation/engine/InitialSessionState.cs +++ b/src/System.Management.Automation/engine/InitialSessionState.cs @@ -1842,10 +1842,13 @@ public Microsoft.PowerShell.ExecutionPolicy ExecutionPolicy /// /// The modules to add /// - public void ImportPSModule(string[] name) + public void ImportPSModule(params string[] name) { if (name == null) + { throw new ArgumentNullException("name"); + } + foreach (string n in name) { ModuleSpecificationsToImport.Add(new ModuleSpecification(n));