diff --git a/LANCommander.SDK/PowerShell/PowerShellScript.cs b/LANCommander.SDK/PowerShell/PowerShellScript.cs index fbf8256..a9ca191 100644 --- a/LANCommander.SDK/PowerShell/PowerShellScript.cs +++ b/LANCommander.SDK/PowerShell/PowerShellScript.cs @@ -32,7 +32,11 @@ namespace LANCommander.SDK.PowerShell Process.StartInfo.RedirectStandardOutput = false; AddArgument("ExecutionPolicy", "Unrestricted"); - AddModule(Path.Combine(Environment.CurrentDirectory, "LANCommander.PowerShell.psd1")); + + var moduleManifests = Directory.EnumerateFiles(Environment.CurrentDirectory, "LANCommander.PowerShell.psd1", SearchOption.AllDirectories); + + if (moduleManifests.Any()) + AddModule(moduleManifests.First()); IgnoreWow64Redirection(); }