Skip to content

Instantly share code, notes, and snippets.

@ypcode
Last active July 7, 2017 07:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ypcode/19ec1b2247ede25fdf4949f2bea33b97 to your computer and use it in GitHub Desktop.
Save ypcode/19ec1b2247ede25fdf4949f2bea33b97 to your computer and use it in GitHub Desktop.
Provision a Hardware Requests SharePoint list to the specified site
$webUrl = "https://<tenant>.sharepoint.com/sites/<yoursite>"
If (Get-PnPContext) {} Else { Connect-PnPOnline $webUrl }
New-PnPList -Template GenericList -Title "Hardware Requests" -Url "HardwareRequests"
$hwList = Get-PnPList -Identity "Hardware Requests"
Add-PnPField -List $hwList -Type Choice -InternalName "HW_HardwareType" -DisplayName "Type" -AddToDefaultView -Required -Choices "Keyboard","Mouse","Display","Hard drive"
Add-PnPField -List $hwList -Type Number -InternalName "HW_Quantity" -DisplayName "Quantity" -AddToDefaultView -Required
Add-PnPField -List $hwList -Type Note -InternalName "HW_Remark" -DisplayName "Remark" -AddToDefaultView -Required
Add-PnPField -List $hwList -Type Boolean -InternalName "HW_Approved" -DisplayName "Approved" -AddToDefaultView
Add-PnPField -List $hwList -Type Note -InternalName "HW_RejectionReason" -DisplayName "Rejection Reason" -AddToDefaultView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment