forked from PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWriteAliasCommandBase.cs
More file actions
88 lines (75 loc) · 2.35 KB
/
Copy pathWriteAliasCommandBase.cs
File metadata and controls
88 lines (75 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using System.Management.Automation;
namespace Microsoft.PowerShell.Commands
{
/// <summary>
/// The base class for the SetAliasCommand and NewAliasCommand.
/// </summary>
public class WriteAliasCommandBase : PSCmdlet
{
#region Parameters
/// <summary>
/// The Name parameter for the command.
/// </summary>
[Parameter(Position = 0, Mandatory = true, ValueFromPipelineByPropertyName = true)]
public string Name { get; set; }
/// <summary>
/// The Value parameter for the command.
/// </summary>
[Parameter(Position = 1, Mandatory = true, ValueFromPipelineByPropertyName = true)]
public string Value { get; set; }
/// <summary>
/// The description for the alias.
/// </summary>
[Parameter]
public string Description { get; set; } = string.Empty;
/// <summary>
/// The Option parameter allows the alias to be set to
/// ReadOnly (for existing aliases) and/or Constant (only
/// for new aliases).
/// </summary>
[Parameter]
public ScopedItemOptions Option { get; set; } = ScopedItemOptions.None;
/// <summary>
/// If set to true, the alias that is set is passed to the pipeline.
/// </summary>
[Parameter]
public SwitchParameter PassThru
{
get
{
return _passThru;
}
set
{
_passThru = value;
}
}
private bool _passThru;
/// <summary>
/// The scope parameter for the command determines which scope the alias is set in.
/// </summary>
[Parameter]
[ArgumentCompleter(typeof(ScopeArgumentCompleter))]
public string Scope { get; set; }
/// <summary>
/// If set to true and an existing alias of the same name exists
/// and is ReadOnly, the alias will be overwritten.
/// </summary>
[Parameter]
public SwitchParameter Force
{
get
{
return _force;
}
set
{
_force = value;
}
}
private bool _force;
#endregion Parameters
}
}