/
githubmirror
/
PowerShell
Обзор
Документация
Войти
/
githubmirror
/
PowerShell
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/Microsoft.PowerShell.Commands.Management/cimSupport/cmdletization/cim/StaticMethodInvocationJob.cs
54 строки
2 KB
xtqqczze
Seal internal types in `Microsoft.PowerShell.Commands.Management` (#25849)
22 авг 2025, 08:01
Не верифицирован
22 авг 2025, 08:01
781c9a5
Код
Авторство
О чём код?
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using System; using Microsoft.Management.Infrastructure; using Microsoft.Management.Infrastructure.Options; namespace Microsoft.PowerShell.Cmdletization.Cim { /// <summary> /// Job wrapping invocation of a static CIM method. /// </summary> internal sealed class StaticMethodInvocationJob : ExtrinsicMethodInvocationJob { internal StaticMethodInvocationJob(CimJobContext jobContext, MethodInvocationInfo methodInvocationInfo) : base(jobContext, false /* passThru */, jobContext.CmdletizationClassName, methodInvocationInfo) { } internal override IObservable<CimMethodResultBase> GetCimOperation() { if (!this.ShouldProcess()) { return null; } CimMethodParametersCollection methodParameters = this.GetCimMethodParametersCollection(); CimOperationOptions operationOptions = this.CreateOperationOptions(); operationOptions.EnableMethodResultStreaming = true; IObservable<CimMethodResultBase> observable = this.JobContext.Session.InvokeMethodAsync( this.JobContext.Namespace, this.JobContext.ClassNameOrNullIfResourceUriIsUsed, this.MethodName, methodParameters, operationOptions); return observable; } internal override object PassThruObject { get { return null; } } internal override CimCustomOptionsDictionary CalculateJobSpecificCustomOptions() { return CimCustomOptionsDictionary.MergeOptions( base.CalculateJobSpecificCustomOptions(), this.GetCimInstancesFromArguments()); } } }