Skip to content
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