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
2 changes: 1 addition & 1 deletion .globalconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ dotnet_diagnostic.IDE0029.severity = silent

# IDE0030: UseCoalesceExpressionForNullable
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0030
dotnet_diagnostic.IDE0030.severity = silent
dotnet_diagnostic.IDE0030.severity = warning

# IDE0031: UseNullPropagation
# https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0031
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public string Description
[Parameter]
public ProcessorArchitecture ProcessorArchitecture
{
get { return _processorArchitecture.HasValue ? _processorArchitecture.Value : ProcessorArchitecture.None; }
get { return _processorArchitecture ?? ProcessorArchitecture.None; }

set { _processorArchitecture = value; }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3521,9 +3521,7 @@ private void BatchInvocationCallback(IAsyncResult result)
ActionPreference preference;
if (_batchInvocationSettings != null)
{
preference = (_batchInvocationSettings.ErrorActionPreference.HasValue) ?
_batchInvocationSettings.ErrorActionPreference.Value
: ActionPreference.Continue;
preference = _batchInvocationSettings.ErrorActionPreference ?? ActionPreference.Continue;
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ public int OpenTimeout
{
get
{
return _openTimeout.HasValue ? _openTimeout.Value :
RunspaceConnectionInfo.DefaultOpenTimeout;
return _openTimeout ?? RunspaceConnectionInfo.DefaultOpenTimeout;
}

set
Expand All @@ -164,8 +163,7 @@ public int CancelTimeout
{
get
{
return _cancelTimeout.HasValue ? _cancelTimeout.Value :
BaseTransportManager.ClientCloseTimeoutMs;
return _cancelTimeout ?? BaseTransportManager.ClientCloseTimeoutMs;
}

set
Expand All @@ -189,8 +187,7 @@ public int IdleTimeout
{
get
{
return _idleTimeout.HasValue ? _idleTimeout.Value
: RunspaceConnectionInfo.DefaultIdleTimeout;
return _idleTimeout ?? RunspaceConnectionInfo.DefaultIdleTimeout;
}

set
Expand Down Expand Up @@ -299,8 +296,7 @@ public int OperationTimeout
{
get
{
return (_operationtimeout.HasValue ? _operationtimeout.Value :
BaseTransportManager.ClientDefaultOperationTimeoutMs);
return _operationtimeout ?? BaseTransportManager.ClientDefaultOperationTimeoutMs;
}

set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ internal ServerRunspacePoolDriver(
// The default server settings is to make new commands execute in the calling thread...this saves
// thread switching time and thread pool pressure on the service.
// Users can override the server settings only if they are administrators
PSThreadOptions serverThreadOptions = configData.ShellThreadOptions.HasValue ? configData.ShellThreadOptions.Value : PSThreadOptions.UseCurrentThread;
PSThreadOptions serverThreadOptions = configData.ShellThreadOptions ?? PSThreadOptions.UseCurrentThread;
if (threadOptions == PSThreadOptions.Default || threadOptions == serverThreadOptions)
{
RunspacePool.ThreadOptions = serverThreadOptions;
Expand All @@ -184,7 +184,7 @@ internal ServerRunspacePoolDriver(
}

// Set Thread ApartmentState for this RunspacePool
ApartmentState serverApartmentState = configData.ShellThreadApartmentState.HasValue ? configData.ShellThreadApartmentState.Value : Runspace.DefaultApartmentState;
ApartmentState serverApartmentState = configData.ShellThreadApartmentState ?? Runspace.DefaultApartmentState;

if (apartmentState == ApartmentState.Unknown || apartmentState == serverApartmentState)
{
Expand Down