public void Run(List <string> Commands)
        {
            try
            {
                if (Commands?.Count > 0)
                {
                    using (runSpace = System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace())
                    {
                        runSpace.Open();

                        using (System.Management.Automation.PowerShell pwsh = System.Management.Automation.PowerShell.Create())
                        {
                            pwsh.Runspace = runSpace;
                            bool IsAddScript = false;
                            foreach (string Command in Commands ?? Enumerable.Empty <string>())
                            {
                                if (!string.IsNullOrEmpty(Command))
                                {
                                    pwsh.AddScript(Command);
                                    IsAddScript = true;
                                }
                            }

                            if (IsAddScript)
                            {
                                IAsyncResult gpcAsyncResult = pwsh.BeginInvoke();
                                _ = pwsh.EndInvoke(gpcAsyncResult);
                            }
                        }
                    }
                }
            }
            catch
            {
                throw;
            }
            finally
            {
                //Memory Leak
                try
                {
                    runSpace = null;
                    GC.Collect();
                }
                catch { }
            }
        }
        public void Run(string Command)
        {
            string[] PrintCommandLines = Command.Split(new string[] { "\n" }, StringSplitOptions.None);

            //NCCFramework.Util.Logger.Debug(ref logger, $@"실행전 : Command = {string.Join("\r\n", PrintCommandLines)} / Now : {DateTime.Now}");

            try
            {
                using (runSpace = System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace())
                {
                    runSpace.Open();

                    using (System.Management.Automation.PowerShell pwsh = System.Management.Automation.PowerShell.Create())
                    {
                        pwsh.Runspace = runSpace;
                        pwsh.AddScript(Command);
                        IAsyncResult gpcAsyncResult = pwsh.BeginInvoke();
                        _ = pwsh.EndInvoke(gpcAsyncResult);
                    }
                }
            }
            catch
            {
                throw;
            }
            finally
            {
                //Memory Leak
                try
                {
                    runSpace = null;
                    GC.Collect();
                }
                catch { }
            }
        }
        public System.Data.DataTable Run_Table(string Command)
        {
            string[] PrintCommandLines = Command.Split(new string[] { "\n" }, StringSplitOptions.None);

            //NCCFramework.Util.Logger.Debug(ref logger, $@"실행전 : Command = {string.Join("\r\n", PrintCommandLines)} / Now : {DateTime.Now}");

            System.Data.DataTable _ret = new System.Data.DataTable();

            try
            {
                using (runSpace = System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace())
                {
                    runSpace.Open();

                    using (System.Management.Automation.PowerShell pwsh = System.Management.Automation.PowerShell.Create())
                    {
                        pwsh.Runspace = runSpace;
                        pwsh.AddScript(Command);
                        IAsyncResult gpcAsyncResult = pwsh.BeginInvoke();

                        using (System.Management.Automation.PSDataCollection <System.Management.Automation.PSObject> ps_result = pwsh.EndInvoke(gpcAsyncResult))
                        {
                            foreach (System.Management.Automation.PSObject psObject in ps_result)
                            {
                                System.Data.DataRow row = _ret.NewRow();

                                foreach (System.Management.Automation.PSPropertyInfo prop in psObject.Properties)
                                {
                                    if (prop != null)
                                    {
                                        if (!_ret.Columns.Contains(prop.Name))
                                        {
                                            if (prop.TypeNameOfValue.ToUpper().Contains("INT"))
                                            {
                                                _ret.Columns.Add(new System.Data.DataColumn(prop.Name, typeof(long)));
                                            }
                                            else
                                            {
                                                _ret.Columns.Add(new System.Data.DataColumn(prop.Name, typeof(string)));
                                            }
                                        }

                                        if (prop.TypeNameOfValue.ToUpper().Contains("STRING[]"))
                                        {
                                            row[prop.Name] = rtnPropValue(propType.Prop_ArrayString, prop.Value);
                                        }
                                        else if (prop.TypeNameOfValue.ToUpper().Contains("DICTIONARY"))
                                        {
                                            row[prop.Name] = rtnPropValue(propType.Prop_Dictionary, prop.Value);
                                        }
                                        else if (prop.TypeNameOfValue.ToUpper().Contains("NULLABLE"))
                                        {
                                            row[prop.Name] = rtnPropValue(propType.Prop_Nullable, prop.Value);
                                        }
                                        else if (prop.TypeNameOfValue.ToUpper().Contains("INT"))
                                        {
                                            row[prop.Name] = prop.Value;
                                        }
                                        else
                                        {
                                            row[prop.Name] = rtnPropValue(propType.Prop_Etc, prop.Value);
                                        }
                                    }
                                }

                                _ret.Rows.Add(row);
                            }
                        }
                    }
                }
            }
            catch
            {
                throw;
            }
            finally
            {
                //Memory Leak
                try
                {
                    runSpace = null;
                    GC.Collect();
                }
                catch { }
            }

            return(_ret);
        }
        public System.Data.DataTable Run_Table(List <string> Commands)
        {
            System.Data.DataTable _ret = new System.Data.DataTable();

            try
            {
                using (runSpace = System.Management.Automation.Runspaces.RunspaceFactory.CreateRunspace())
                {
                    runSpace.Open();

                    using (System.Management.Automation.PowerShell pwsh = System.Management.Automation.PowerShell.Create())
                    {
                        pwsh.Runspace = runSpace;

                        bool IsAddScript = false;
                        foreach (string Command in Commands ?? Enumerable.Empty <string>())
                        {
                            if (!string.IsNullOrEmpty(Command))
                            {
                                pwsh.AddScript(Command);
                                IsAddScript = true;
                            }
                        }

                        if (IsAddScript)
                        {
                            IAsyncResult gpcAsyncResult = pwsh.BeginInvoke();

                            using (System.Management.Automation.PSDataCollection <System.Management.Automation.PSObject> ps_result = pwsh.EndInvoke(gpcAsyncResult))
                            {
                                foreach (System.Management.Automation.PSObject psObject in ps_result)
                                {
                                    System.Data.DataRow row = _ret.NewRow();

                                    foreach (System.Management.Automation.PSPropertyInfo prop in psObject.Properties)
                                    {
                                        if (prop != null)
                                        {
                                            if (!_ret.Columns.Contains(prop.Name))
                                            {
                                                if (prop.TypeNameOfValue.ToUpper().Contains("INT"))
                                                {
                                                    _ret.Columns.Add(new System.Data.DataColumn(prop.Name, typeof(long)));
                                                }
                                                else
                                                {
                                                    _ret.Columns.Add(new System.Data.DataColumn(prop.Name, typeof(string)));
                                                }
                                            }

                                            if (prop.TypeNameOfValue.ToUpper().Contains("STRING[]"))
                                            {
                                                row[prop.Name] = rtnPropValue(propType.Prop_ArrayString, prop.Value);
                                            }
                                            else if (prop.TypeNameOfValue.ToUpper().Contains("DICTIONARY"))
                                            {
                                                row[prop.Name] = rtnPropValue(propType.Prop_Dictionary, prop.Value);
                                            }
                                            else if (prop.TypeNameOfValue.ToUpper().Contains("NULLABLE"))
                                            {
                                                row[prop.Name] = rtnPropValue(propType.Prop_Nullable, prop.Value);
                                            }
                                            else if (prop.TypeNameOfValue.ToUpper().Contains("INT"))
                                            {
                                                row[prop.Name] = prop.Value;
                                            }
                                            else
                                            {
                                                row[prop.Name] = rtnPropValue(propType.Prop_Etc, prop.Value);
                                            }
                                        }
                                    }

                                    _ret.Rows.Add(row);
                                }
                            }
                        }
                    }
                }
            }
            catch
            {
                throw;
            }
            finally
            {
                //Memory Leak
                try
                {
                    runSpace = null;
                    GC.Collect();
                }
                catch { }
            }

            return(_ret);
        }