Skip to content

Commit 26fb600

Browse files
committed
Updated all cmdlets that reference ListPipeBind to use the Parameter Completer
1 parent 5152b45 commit 26fb600

File tree

59 files changed

+128
-35
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+128
-35
lines changed

src/Commands/ContentTypes/AddContentTypeToList.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Microsoft.SharePoint.Client;
2+
using PnP.PowerShell.Commands.Base.Completers;
23
using PnP.PowerShell.Commands.Base.PipeBinds;
34
using System.Management.Automation;
45

@@ -8,6 +9,7 @@ namespace PnP.PowerShell.Commands.ContentTypes
89
public class AddContentTypeToList : PnPWebCmdlet
910
{
1011
[Parameter(Mandatory = true)]
12+
[ArgumentCompleter(typeof(ListNameCompleter))]
1113
public ListPipeBind List;
1214

1315
[Parameter(Mandatory = true)]

src/Commands/ContentTypes/GetContentType.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using PnP.PowerShell.Commands.Base.PipeBinds;
77
using System;
88
using System.Collections.Generic;
9+
using PnP.PowerShell.Commands.Base.Completers;
910

1011
namespace PnP.PowerShell.Commands.ContentTypes
1112
{
@@ -20,14 +21,15 @@ public class GetContentType : PnPWebRetrievalsCmdlet<ContentType>
2021

2122
[Parameter(Mandatory = false, ValueFromPipeline = true)]
2223
[ValidateNotNullOrEmpty]
24+
[ArgumentCompleter(typeof(ListNameCompleter))]
2325
public ListPipeBind List;
24-
26+
2527
[Parameter(Mandatory = false, ValueFromPipeline = false)]
2628
public SwitchParameter InSiteHierarchy;
2729

2830
protected override void ExecuteCmdlet()
2931
{
30-
DefaultRetrievalExpressions = new Expression<Func<ContentType, object>>[] {ct => ct.Id, ct => ct.Name, ct => ct.StringId, ct => ct.Group };
32+
DefaultRetrievalExpressions = new Expression<Func<ContentType, object>>[] { ct => ct.Id, ct => ct.Name, ct => ct.StringId, ct => ct.Group };
3133

3234
if (List != null)
3335
{

src/Commands/ContentTypes/RemoveContentTypeFromList.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using PnP.PowerShell.Commands.Base.PipeBinds;
1+
using PnP.PowerShell.Commands.Base.Completers;
2+
using PnP.PowerShell.Commands.Base.PipeBinds;
23
using System.Management.Automation;
34

45
namespace PnP.PowerShell.Commands.ContentTypes
@@ -8,6 +9,7 @@ public class RemoveContentTypeFromList : PnPWebCmdlet
89
{
910
[Parameter(Mandatory = true)]
1011
[ValidateNotNullOrEmpty]
12+
[ArgumentCompleter(typeof(ListNameCompleter))]
1113
public ListPipeBind List;
1214

1315
[Parameter(Mandatory = true)]

src/Commands/ContentTypes/SetContentType.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Microsoft.SharePoint.Client;
2+
using PnP.PowerShell.Commands.Base.Completers;
23
using PnP.PowerShell.Commands.Base.PipeBinds;
34
using System.Management.Automation;
45

@@ -17,6 +18,7 @@ public class SetContentType : PnPWebCmdlet
1718
[Parameter(Mandatory = false, ValueFromPipeline = true, ParameterSetName = ParameterSet_FormCustomizersConvenienceParams)]
1819
[Parameter(Mandatory = false, ValueFromPipeline = true, ParameterSetName = ParameterSet_FormCustomizersParams)]
1920
[ValidateNotNullOrEmpty]
21+
[ArgumentCompleter(typeof(ListNameCompleter))]
2022
public ListPipeBind List;
2123

2224
[Parameter(Mandatory = false, ParameterSetName = ParameterSet_FormCustomizersConvenienceParams)]

src/Commands/ContentTypes/SetDefaultContentTypeToList.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.Management.Automation;
22
using Microsoft.SharePoint.Client;
3-
3+
using PnP.PowerShell.Commands.Base.Completers;
44
using PnP.PowerShell.Commands.Base.PipeBinds;
55

66
namespace PnP.PowerShell.Commands.ContentTypes
@@ -10,6 +10,7 @@ public class SetDefaultContentTypeToList : PnPWebCmdlet
1010
{
1111
[Parameter(Mandatory = true)]
1212
[ValidateNotNullOrEmpty]
13+
[ArgumentCompleter(typeof(ListNameCompleter))]
1314
public ListPipeBind List;
1415

1516
[Parameter(Mandatory = true)]

src/Commands/Diagnostic/MeasurePnPList.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77

88
using PnP.PowerShell.Commands.Base.PipeBinds;
99
using System.Collections.Generic;
10+
using PnP.PowerShell.Commands.Base.Completers;
1011

1112
namespace PnP.PowerShell.Commands.Diagnostic
1213
{
1314
[Cmdlet(VerbsDiagnostic.Measure, "PnPList")]
1415
public class MeasurePnPList : PnPWebRetrievalsCmdlet<List>
1516
{
1617
[Parameter(Mandatory = true, ValueFromPipeline = true, Position = 0)]
18+
[ArgumentCompleter(typeof(ListNameCompleter))]
1719
public ListPipeBind Identity;
1820

1921
[Parameter(Mandatory = false)]

src/Commands/DocumentSets/AddDocumentSet.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
using PnP.PowerShell.Commands.Base.PipeBinds;
66
using System.Linq;
7+
using PnP.PowerShell.Commands.Base.Completers;
78

89
namespace PnP.PowerShell.Commands.DocumentSets
910
{
@@ -13,6 +14,7 @@ public class AddDocumentSet : PnPWebCmdlet
1314
{
1415
[Parameter(Mandatory = true)]
1516
[ValidateNotNullOrEmpty]
17+
[ArgumentCompleter(typeof(ListNameCompleter))]
1618
public ListPipeBind List;
1719

1820
[Parameter(Mandatory = true)]

src/Commands/Events/AddEventReceiver.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Management.Automation;
22
using Microsoft.SharePoint.Client;
3+
using PnP.PowerShell.Commands.Base.Completers;
34
using PnP.PowerShell.Commands.Base.PipeBinds;
45

56
namespace PnP.PowerShell.Commands.Events
@@ -12,6 +13,7 @@ public class AddEventReceiver : PnPWebCmdlet
1213
private const string ParameterSet_SCOPE = "On a web or site";
1314

1415
[Parameter(Mandatory = true, ParameterSetName = ParameterSet_LIST)]
16+
[ArgumentCompleter(typeof(ListNameCompleter))]
1517
public ListPipeBind List;
1618

1719
[Parameter(ParameterSetName = ParameterSet_LIST)]

src/Commands/Events/GetEventReceiver.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System.Collections.Generic;
22
using System.Management.Automation;
33
using Microsoft.SharePoint.Client;
4+
using PnP.PowerShell.Commands.Base.Completers;
45
using PnP.PowerShell.Commands.Base.PipeBinds;
56

67
namespace PnP.PowerShell.Commands.Events
@@ -14,6 +15,7 @@ public class GetEventReceiver : PnPWebRetrievalsCmdlet<EventReceiverDefinition>
1415
private const string ParameterSet_SCOPE = "On a web or site";
1516

1617
[Parameter(Mandatory = true, ParameterSetName = ParameterSet_LIST)]
18+
[ArgumentCompleter(typeof(ListNameCompleter))]
1719
public ListPipeBind List;
1820

1921
[Parameter(ParameterSetName = ParameterSet_LIST)]

src/Commands/Events/RemoveEventReceiver.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Microsoft.SharePoint.Client;
2+
using PnP.PowerShell.Commands.Base.Completers;
23
using PnP.PowerShell.Commands.Base.PipeBinds;
34
using System.Collections.Generic;
45
using System.Management.Automation;
@@ -13,6 +14,7 @@ public class RemoveEventReceiver : PnPWebCmdlet
1314
private const string ParameterSet_SCOPE = "From a web or site";
1415

1516
[Parameter(Mandatory = true, ParameterSetName = ParameterSet_LIST)]
17+
[ArgumentCompleter(typeof(ListNameCompleter))]
1618
public ListPipeBind List;
1719

1820
[Parameter(ParameterSetName = ParameterSet_LIST)]

0 commit comments

Comments
 (0)