diff --git a/src/System.Management.Automation/engine/InitialSessionState.cs b/src/System.Management.Automation/engine/InitialSessionState.cs index 701d9f0a85..8c4cc0d0e2 100644 --- a/src/System.Management.Automation/engine/InitialSessionState.cs +++ b/src/System.Management.Automation/engine/InitialSessionState.cs @@ -1842,10 +1842,13 @@ namespace System.Management.Automation.Runspaces /// /// 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));