Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ public sealed class NewObjectCommand : PSCmdlet
[Parameter(ParameterSetName = netSetName, Mandatory = true, Position = 0)]
public string TypeName { get; set; } = null;


#if !UNIX
private Guid _comObjectClsId = Guid.Empty;
/// <summary> the ProgID of the Com object</summary>
[Parameter(ParameterSetName = "Com", Mandatory = true, Position = 0)]
public string ComObject { get; set; } = null;

#endif

/// <summary>
/// The parameters for the constructor
Expand Down Expand Up @@ -245,6 +245,7 @@ protected override void BeginProcessing()
"CannotFindAppropriateCtor",
ErrorCategory.ObjectNotFound, null));
}
#if !UNIX
else // Parameterset -Com
{
int result = NewObjectNativeMethods.CLSIDFromProgID(ComObject, out _comObjectClsId);
Expand Down Expand Up @@ -295,10 +296,12 @@ protected override void BeginProcessing()
}
WriteObject(comObject);
}
#endif
}//protected override void BeginProcessing()

#endregion Overrides

#if !UNIX
#region Com

private object SafeCreateInstance(Type t, object[] args)
Expand Down Expand Up @@ -467,6 +470,7 @@ private object CreateComObject()
}

#endregion Com
#endif

// HResult code '-2147417850' - Cannot change thread mode after it is set.
private const int RPC_E_CHANGED_MODE = unchecked((int)0x80010106);
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.