@@ -31,12 +31,12 @@ public sealed class NewObjectCommand : PSCmdlet
31
31
[ Parameter ( ParameterSetName = netSetName , Mandatory = true , Position = 0 ) ]
32
32
public string TypeName { get ; set ; } = null ;
33
33
34
-
34
+ #if ! UNIX
35
35
private Guid _comObjectClsId = Guid . Empty ;
36
36
/// <summary> the ProgID of the Com object</summary>
37
37
[ Parameter ( ParameterSetName = "Com" , Mandatory = true , Position = 0 ) ]
38
38
public string ComObject { get ; set ; } = null ;
39
-
39
+ #endif
40
40
41
41
/// <summary>
42
42
/// The parameters for the constructor
@@ -245,6 +245,7 @@ protected override void BeginProcessing()
245
245
"CannotFindAppropriateCtor" ,
246
246
ErrorCategory . ObjectNotFound , null ) ) ;
247
247
}
248
+ #if ! UNIX
248
249
else // Parameterset -Com
249
250
{
250
251
int result = NewObjectNativeMethods . CLSIDFromProgID ( ComObject , out _comObjectClsId ) ;
@@ -295,10 +296,12 @@ protected override void BeginProcessing()
295
296
}
296
297
WriteObject ( comObject ) ;
297
298
}
299
+ #endif
298
300
} //protected override void BeginProcessing()
299
301
300
302
#endregion Overrides
301
303
304
+ #if ! UNIX
302
305
#region Com
303
306
304
307
private object SafeCreateInstance ( Type t , object [ ] args )
@@ -467,6 +470,7 @@ private object CreateComObject()
467
470
}
468
471
469
472
#endregion Com
473
+ #endif
470
474
471
475
// HResult code '-2147417850' - Cannot change thread mode after it is set.
472
476
private const int RPC_E_CHANGED_MODE = unchecked ( ( int ) 0x80010106 ) ;
0 commit comments