Ejemplo n.º 1
-1
        public static void CreateInstanceSync(CimSession cimSession, string cimNamespace, string cimClassName)
        {
            try
            {
                CimInstance createInstance = CreateInstanceCore(cimSession, cimNamespace, cimClassName);
                if (createInstance == null)
                {
                    Console.WriteLine("CreateInstance operation not performed");
                    return;
                }

                CimInstance cimInstance = cimSession.CreateInstance(cimNamespace, createInstance);
                Console.WriteLine("Instance Created Successfully");
                PrintCimInstance(cimInstance);
            }
            catch (CimException ex)
            {
                PrintCimException(ex);
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }