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 @@ -18,7 +18,7 @@ public abstract class MeasureInfo
/// <summary>
/// Property name.
/// </summary>
public string Property { get; set; } = null;
public string Property { get; set; }
}

/// <summary>
Expand Down Expand Up @@ -244,7 +244,7 @@ public MeasureObjectCommand()
/// <value></value>
[ValidateNotNullOrEmpty]
[Parameter(Position = 0)]
public PSPropertyExpression[] Property { get; set; } = null;
public PSPropertyExpression[] Property { get; set; }

#endregion Common parameters in both sets

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public sealed class NewObjectCommand : PSCmdlet
/// <summary> the number</summary>
[Parameter(ParameterSetName = netSetName, Mandatory = true, Position = 0)]
[ValidateTrustedData]
public string TypeName { get; set; } = null;
public string TypeName { get; set; }

#if !UNIX
private Guid _comObjectClsId = Guid.Empty;
Expand All @@ -43,7 +43,7 @@ public sealed class NewObjectCommand : PSCmdlet
/// </summary>
[Parameter(ParameterSetName = "Com", Mandatory = true, Position = 0)]
[ValidateTrustedData]
public string ComObject { get; set; } = null;
public string ComObject { get; set; }
#endif

/// <summary>
Expand All @@ -53,7 +53,7 @@ public sealed class NewObjectCommand : PSCmdlet
[Parameter(ParameterSetName = netSetName, Mandatory = false, Position = 1)]
[ValidateTrustedData]
[Alias("Args")]
public object[] ArgumentList { get; set; } = null;
public object[] ArgumentList { get; set; }

/// <summary>
/// True if we should have an error when Com objects will use an interop assembly.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,25 +68,25 @@ public DateTime End
/// Allows the user to override the day.
/// </summary>
[Parameter(ParameterSetName = "Time")]
public int Days { get; set; } = 0;
public int Days { get; set; }

/// <summary>
/// Allows the user to override the hour.
/// </summary>
[Parameter(ParameterSetName = "Time")]
public int Hours { get; set; } = 0;
public int Hours { get; set; }

/// <summary>
/// Allows the user to override the minute.
/// </summary>
[Parameter(ParameterSetName = "Time")]
public int Minutes { get; set; } = 0;
public int Minutes { get; set; }

/// <summary>
/// Allows the user to override the second.
/// </summary>
[Parameter(ParameterSetName = "Time")]
public int Seconds { get; set; } = 0;
public int Seconds { get; set; }

#endregion

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ internal sealed class OrderByProperty
/// <summary>
/// A logical matrix where each row is an input object and its property values specified by Properties.
/// </summary>
internal List<OrderByPropertyEntry> OrderMatrix { get; } = null;
internal List<OrderByPropertyEntry> OrderMatrix { get; }

internal OrderByPropertyComparer Comparer { get; } = null;
internal OrderByPropertyComparer Comparer { get; }

internal List<MshParameter> MshParameterList
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,14 @@ public sealed class SelectObjectCommand : PSCmdlet
/// <value></value>
[Parameter(ParameterSetName = "DefaultParameter")]
[Parameter(ParameterSetName = "SkipLastParameter")]
public string[] ExcludeProperty { get; set; } = null;
public string[] ExcludeProperty { get; set; }

/// <summary>
/// </summary>
/// <value></value>
[Parameter(ParameterSetName = "DefaultParameter")]
[Parameter(ParameterSetName = "SkipLastParameter")]
public string ExpandProperty { get; set; } = null;
public string ExpandProperty { get; set; }

/// <summary>
/// </summary>
Expand Down Expand Up @@ -152,14 +152,14 @@ public int First
/// <value></value>
[Parameter(ParameterSetName = "DefaultParameter")]
[ValidateRange(0, int.MaxValue)]
public int Skip { get; set; } = 0;
public int Skip { get; set; }

/// <summary>
/// Skip the specified number of items from end.
/// </summary>
[Parameter(ParameterSetName = "SkipLastParameter")]
[ValidateRange(0, int.MaxValue)]
public int SkipLast { get; set; } = 0;
public int SkipLast { get; set; }

/// <summary>
/// With this switch present, the cmdlet won't "short-circuit"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ public SwitchParameter Descending
/// </summary>
[Parameter(ParameterSetName = "Top", Mandatory = true)]
[ValidateRange(1, int.MaxValue)]
public int Top { get; set; } = 0;
public int Top { get; set; }

/// <summary>
/// Gets or sets the number of items to return in a Bottom N sort.
/// </summary>
[Parameter(ParameterSetName = "Bottom", Mandatory = true)]
[ValidateRange(1, int.MaxValue)]
public int Bottom { get; set; } = 0;
public int Bottom { get; set; }

/// <summary>
/// Moves unique entries to the front of the list.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public virtual int MaximumRedirection
/// </summary>
[Parameter]
[ValidateRange(0, Int32.MaxValue)]
public virtual int MaximumRetryCount { get; set; } = 0;
public virtual int MaximumRetryCount { get; set; }

/// <summary>
/// Gets or sets the RetryIntervalSec property, which determines the number seconds between retries.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public sealed class WriteDebugCommand : PSCmdlet
[Parameter(Position = 0, Mandatory = true, ValueFromPipeline = true)]
[AllowEmptyString]
[Alias("Msg")]
public string Message { get; set; } = null;
public string Message { get; set; }

/// <summary>
/// This method implements the ProcessRecord method for Write-Debug command.
Expand Down Expand Up @@ -69,7 +69,7 @@ public sealed class WriteVerboseCommand : PSCmdlet
[Parameter(Position = 0, Mandatory = true, ValueFromPipeline = true)]
[AllowEmptyString]
[Alias("Msg")]
public string Message { get; set; } = null;
public string Message { get; set; }

/// <summary>
/// This method implements the ProcessRecord method for Write-verbose command.
Expand Down Expand Up @@ -117,7 +117,7 @@ public sealed class WriteWarningCommand : PSCmdlet
[Parameter(Position = 0, Mandatory = true, ValueFromPipeline = true)]
[AllowEmptyString]
[Alias("Msg")]
public string Message { get; set; } = null;
public string Message { get; set; }

/// <summary>
/// This method implements the ProcessRecord method for Write-Warning command.
Expand Down Expand Up @@ -215,7 +215,7 @@ public class WriteOrThrowErrorCommand : PSCmdlet
/// ErrorRecord.Exception -- if not specified, ErrorRecord.Exception is System.Exception.
/// </summary>
[Parameter(ParameterSetName = "WithException", Mandatory = true)]
public Exception Exception { get; set; } = null;
public Exception Exception { get; set; }

/// <summary>
/// If Exception is specified, this is ErrorRecord.ErrorDetails.Message;
Expand All @@ -226,14 +226,14 @@ public class WriteOrThrowErrorCommand : PSCmdlet
[AllowNull]
[AllowEmptyString]
[Alias("Msg")]
public string Message { get; set; } = null;
public string Message { get; set; }

/// <summary>
/// If Exception is specified, this is ErrorRecord.ErrorDetails.Message;
/// otherwise, the Exception is System.Exception, and this is Exception.Message.
/// </summary>
[Parameter(ParameterSetName = "ErrorRecord", Mandatory = true)]
public ErrorRecord ErrorRecord { get; set; } = null;
public ErrorRecord ErrorRecord { get; set; }

/// <summary>
/// ErrorRecord.CategoryInfo.Category.
Expand All @@ -254,7 +254,7 @@ public class WriteOrThrowErrorCommand : PSCmdlet
/// </summary>
[Parameter(ParameterSetName = "NoException")]
[Parameter(ParameterSetName = "WithException")]
public object TargetObject { get; set; } = null;
public object TargetObject { get; set; }

/// <summary>
/// ErrorRecord.ErrorDetails.RecommendedAction.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public sealed class WriteHostCommand : ConsoleColorCmdlet
/// </summary>
[Parameter(Position = 0, ValueFromRemainingArguments = true, ValueFromPipeline = true)]
[Alias("Msg", "Message")]
public object Object { get; set; } = null;
public object Object { get; set; }

/// <summary>
/// False to add a newline to the end of the output string, true if not.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public sealed class WriteProgressCommand : PSCmdlet
/// </summary>
[Parameter(Position = 2)]
[ValidateRange(0, Int32.MaxValue)]
public int Id { get; set; } = 0;
public int Id { get; set; }

/// <summary>
/// Percentage completion of the activity, or -1 if n/a.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public sealed class ExportClixmlCommand : PSCmdlet, IDisposable
/// </summary>
[Parameter]
[ValidateRange(1, int.MaxValue)]
public int Depth { get; set; } = 0;
public int Depth { get; set; }

/// <summary>
/// Mandatory file name to write to.
Expand Down Expand Up @@ -388,7 +388,7 @@ public sealed class ConvertToXmlCommand : PSCmdlet, IDisposable
/// </summary>
[Parameter(HelpMessage = "Specifies how many levels of contained objects should be included in the XML representation")]
[ValidateRange(1, int.MaxValue)]
public int Depth { get; set; } = 0;
public int Depth { get; set; }

/// <summary>
/// Input Object which is written to XML format.
Expand Down