-
Notifications
You must be signed in to change notification settings - Fork 805
Expand file tree
/
Copy pathPowerShell.cs
More file actions
35 lines (31 loc) · 1.41 KB
/
PowerShell.cs
File metadata and controls
35 lines (31 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using NETworkManager.Models.PowerShell;
using NETworkManager.Settings;
namespace NETworkManager.Profiles.Application;
public class PowerShell
{
public static PowerShellSessionInfo CreateSessionInfo(ProfileInfo profile)
{
// Get group info
var group = ProfileManager.GetGroupByName(profile.Group);
return new PowerShellSessionInfo
{
EnableRemoteConsole = profile.PowerShell_EnableRemoteConsole,
Host = profile.PowerShell_Host,
Command = profile.PowerShell_OverrideCommand
? profile.PowerShell_Command
: group.PowerShell_OverrideCommand
? group.PowerShell_Command
: SettingsManager.Current.PowerShell_Command,
AdditionalCommandLine = profile.PowerShell_OverrideAdditionalCommandLine
? profile.PowerShell_AdditionalCommandLine
: group.PowerShell_OverrideAdditionalCommandLine
? group.PowerShell_AdditionalCommandLine
: SettingsManager.Current.PowerShell_AdditionalCommandLine,
ExecutionPolicy = profile.PowerShell_OverrideExecutionPolicy
? profile.PowerShell_ExecutionPolicy
: group.PowerShell_OverrideExecutionPolicy
? group.PowerShell_ExecutionPolicy
: SettingsManager.Current.PowerShell_ExecutionPolicy
};
}
}