Skip to content
Open
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 @@ -572,7 +572,7 @@ public sealed class GetServiceCommand : MultipleServiceCommandBase
/// since it is optional for GetService and mandatory otherwise.
/// </remarks>
[Parameter(Position = 0, ParameterSetName = "Default", ValueFromPipelineByPropertyName = true, ValueFromPipeline = true)]
[ValidateNotNullOrEmpty()]
[ValidateNotNullOrEmpty]
[Alias("ServiceName")]
public string[] Name
{
Expand Down Expand Up @@ -1547,7 +1547,7 @@ public class SetServiceCommand : ServiceOperationBaseCommand
/// </summary>
/// <value></value>
[Parameter]
[Credential()]
[Credential]
public PSCredential Credential { get; set; }

/// <summary>
Expand Down Expand Up @@ -2085,7 +2085,7 @@ public ServiceStartupType StartupType
/// </summary>
/// <value></value>
[Parameter]
[Credential()]
[Credential]
public PSCredential Credential
{
get { return credential; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class GetPSBreakpointCommand : PSBreakpointAccessorCommandBase
[Parameter(ParameterSetName = CommandParameterSetName)]
[Parameter(ParameterSetName = VariableParameterSetName)]
[Parameter(ParameterSetName = TypeParameterSetName)]
[ValidateNotNullOrEmpty()]
[ValidateNotNullOrEmpty]
public string[] Script { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class GetAliasCommand : PSCmdlet
/// The Name parameter for the command.
/// </summary>
[Parameter(ParameterSetName = "Default", Position = 0, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true)]
[ValidateNotNullOrEmpty()]
[ValidateNotNullOrEmpty]
public string[] Name
{
get { return _names; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public sealed class GetRunspaceCommand : PSCmdlet
/// </summary>
[Parameter(Position = 0,
ParameterSetName = GetRunspaceCommand.NameParameterSet)]
[ValidateNotNullOrEmpty()]
[ValidateNotNullOrEmpty]
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public string[] Name
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public class GetVariableCommand : VariableCommandBase
/// Name of the PSVariable.
/// </summary>
[Parameter(Position = 0, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true)]
[ValidateNotNullOrEmpty()]
[ValidateNotNullOrEmpty]
public string[] Name
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class GetTraceSourceCommand : TraceCommandBase
/// </summary>
/// <value></value>
[Parameter(Position = 0, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true)]
[ValidateNotNullOrEmpty()]
[ValidateNotNullOrEmpty]
public string[] Name
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ internal class CShellLink { }
internal interface IShellLinkW
{
void GetPath(
[Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszFile,
[Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszFile,
int cchMaxPath,
IntPtr pfd,
uint fFlags);
Expand All @@ -61,22 +61,22 @@ void GetPath(
void SetIDList(IntPtr pidl);

void GetDescription(
[Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszFile,
[Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszFile,
int cchMaxName);

void SetDescription(
[MarshalAs(UnmanagedType.LPWStr)] string pszName);

void GetWorkingDirectory(
[Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszDir,
[Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszDir,
int cchMaxPath
);

void SetWorkingDirectory(
[MarshalAs(UnmanagedType.LPWStr)] string pszDir);

void GetArguments(
[Out(), MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszArgs,
[Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszArgs,
int cchMaxPath);

void SetArguments(
Expand All @@ -91,7 +91,7 @@ void SetArguments(
void SetShowCmd(uint iShowCmd);

void GetIconLocation(
[Out(), MarshalAs(UnmanagedType.LPWStr)] out StringBuilder pszIconPath,
[Out, MarshalAs(UnmanagedType.LPWStr)] out StringBuilder pszIconPath,
int cchIconPath,
out int iIcon);

Expand Down Expand Up @@ -172,7 +172,7 @@ void SetAppID(
HResult BeginList(
out uint cMaxSlots,
ref Guid riid,
[Out(), MarshalAs(UnmanagedType.Interface)] out object ppvObject);
[Out, MarshalAs(UnmanagedType.Interface)] out object ppvObject);

[PreserveSig]
HResult AppendCategory(
Expand All @@ -190,7 +190,7 @@ HResult AddUserTasks(

void GetRemovedDestinations(
ref Guid riid,
[Out(), MarshalAs(UnmanagedType.Interface)] out object ppvObject);
[Out, MarshalAs(UnmanagedType.Interface)] out object ppvObject);

void DeleteList(
[MarshalAs(UnmanagedType.LPWStr)] string pszAppID);
Expand All @@ -214,7 +214,7 @@ internal interface IObjectArray
void GetAt(
uint iIndex,
ref Guid riid,
[Out(), MarshalAs(UnmanagedType.Interface)] out object ppvObject);
[Out, MarshalAs(UnmanagedType.Interface)] out object ppvObject);
}

[ComImport]
Expand All @@ -228,7 +228,7 @@ internal interface IObjectCollection
void GetAt(
uint iIndex,
ref Guid riid,
[Out(), MarshalAs(UnmanagedType.Interface)] out object ppvObject);
[Out, MarshalAs(UnmanagedType.Interface)] out object ppvObject);

// IObjectCollection
void AddObject(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace System.Management.Automation
/// This attribute is used to specify an argument completer for a parameter to a cmdlet or function.
/// <example>
/// <code>
/// [Parameter()]
/// [Parameter]
/// [ArgumentCompleter(typeof(NounArgumentCompleter))]
/// public string Noun { get; set; }
/// </code>
Expand Down Expand Up @@ -197,7 +197,7 @@ public class RegisterArgumentCompleterCommand : PSCmdlet
/// Gets or sets the script block that will be executed to provide argument completions.
/// </summary>
[Parameter(Mandatory = true)]
[AllowNull()]
[AllowNull]
public ScriptBlock ScriptBlock { get; set; }

/// <summary>
Expand Down Expand Up @@ -284,7 +284,7 @@ static void SetKeyValue(Dictionary<string, ScriptBlock> table, string key, Scrip
/// This attribute is used to specify an argument completions for a parameter of a cmdlet or function
/// based on string array.
/// <example>
/// [Parameter()]
/// [Parameter]
/// [ArgumentCompletions("Option1","Option2","Option3")]
/// public string Noun { get; set; }
/// </example>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public string[] Module
/// <summary>
/// Gets or sets the ExcludeModule parameter to the cmdlet.
/// </summary>
[Parameter()]
[Parameter]
public string[] ExcludeModule
{
get
Expand Down Expand Up @@ -241,7 +241,7 @@ public SwitchParameter Syntax
/// This parameter causes the output to be packaged into ShowCommandInfo PSObject types
/// needed to display GUI command information.
/// </summary>
[Parameter()]
[Parameter]
public SwitchParameter ShowCommandInfo { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7631,7 +7631,7 @@ public class FileSystemProviderGetItemDynamicParameters
/// A parameter to return the streams of an item.
/// </summary>
[Parameter]
[ValidateNotNullOrEmpty()]
[ValidateNotNullOrEmpty]
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public string[] Stream { get; set; }
#endif
Expand All @@ -7647,7 +7647,7 @@ public class FileSystemProviderRemoveItemDynamicParameters
/// A parameter to return the streams of an item.
/// </summary>
[Parameter]
[ValidateNotNullOrEmpty()]
[ValidateNotNullOrEmpty]
[SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
public string[] Stream { get; set; }
#endif
Expand Down