external help file | applicable | schema |
---|---|---|
SharePoint Server 2013, SharePoint Server 2016, SharePoint Online |
2.0.0 |
Add a field
Add-PnPField [-AddToDefaultView [<SwitchParameter>]]
[-Required [<SwitchParameter>]]
[-Group <String>]
[-Web <WebPipeBind>]
[-Connection <SPOnlineConnection>]
Add-PnPField -List <ListPipeBind>
-Field <FieldPipeBind>
[-Web <WebPipeBind>]
[-Connection <SPOnlineConnection>]
Add-PnPField -DisplayName <String>
-InternalName <String>
-Type <FieldType>
[-List <ListPipeBind>]
[-Id <GuidPipeBind>]
[-AddToDefaultView [<SwitchParameter>]]
[-Required [<SwitchParameter>]]
[-Group <String>]
[-ClientSideComponentId <GuidPipeBind>]
[-ClientSideComponentProperties <String>]
[-Choices <String[]>]
[-Web <WebPipeBind>]
[-Connection <SPOnlineConnection>]
Add-PnPField -DisplayName <String>
-InternalName <String>
-Type <FieldType>
[-Id <GuidPipeBind>]
[-ClientSideComponentId <GuidPipeBind>]
[-ClientSideComponentProperties <String>]
[-Choices <String[]>]
[-Web <WebPipeBind>]
[-Connection <SPOnlineConnection>]
Adds a field to a list or as a site column
PS:> Add-PnPField -List "Demo list" -DisplayName "Location" -InternalName "SPSLocation" -Type Choice -Group "Demo Group" -AddToDefaultView -Choices "Stockholm","Helsinki","Oslo"
This will add a field of type Choice to the list "Demo List".
PS:>Add-PnPField -List "Demo list" -DisplayName "Speakers" -InternalName "SPSSpeakers" -Type MultiChoice -Group "Demo Group" -AddToDefaultView -Choices "Obiwan Kenobi","Darth Vader", "Anakin Skywalker"
This will add a field of type Multiple Choice to the list "Demo List". (you can pick several choices for the same item)
Switch Parameter if this field must be added to the default view
Type: SwitchParameter
Parameter Sets: Add field to list
Required: False
Position: Named
Accept pipeline input: False
Specify choices, only valid if the field type is Choice
Type: String[]
Parameter Sets: Add field to list
Required: False
Position: 0
Accept pipeline input: False
The Client Side Component Id to set to the field
Type: GuidPipeBind
Parameter Sets: Add field to list
Required: False
Position: Named
Accept pipeline input: False
The Client Side Component Properties to set to the field
Type: String
Parameter Sets: Add field to list
Required: False
Position: Named
Accept pipeline input: False
The display name of the field
Type: String
Parameter Sets: Add field to list
Required: True
Position: Named
Accept pipeline input: False
The name of the field, its ID or an actual field object that needs to be added
Type: FieldPipeBind
Parameter Sets: Add field reference to list
Required: True
Position: Named
Accept pipeline input: False
The group name to where this field belongs to
Type: String
Parameter Sets: Add field to list
Required: False
Position: Named
Accept pipeline input: False
The ID of the field, must be unique
Type: GuidPipeBind
Parameter Sets: Add field to list
Required: False
Position: Named
Accept pipeline input: False
The internal name of the field
Type: String
Parameter Sets: Add field to list
Required: True
Position: Named
Accept pipeline input: False
The name of the list, its ID or an actual list object where this field needs to be added
Type: ListPipeBind
Parameter Sets: Add field to list
Required: False
Position: Named
Accept pipeline input: True
Switch Parameter if the field is a required field
Type: SwitchParameter
Parameter Sets: Add field to list
Required: False
Position: Named
Accept pipeline input: False
The type of the field like Choice, Note, MultiChoice
Type: FieldType
Parameter Sets: Add field to list
Required: True
Position: Named
Accept pipeline input: False
Optional connection to be used by cmdlet. Retrieve the value for this parameter by eiter specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection.
Type: SPOnlineConnection
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False
This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web.
Type: WebPipeBind
Parameter Sets: (All)
Required: False
Position: Named
Accept pipeline input: False