The following is a function that you can use to delete a list from SharePoint 2010 in Visual Studio .NET

Encoding QR-Code in Visual Studio .NET The following is a function that you can use to delete a list from SharePoint 2010

The following is a function that you can use to delete a list from SharePoint 2010
Recognizing QR In .NET
Using Barcode Control SDK for .NET Control to generate, create, read, scan barcode image in VS .NET applications.
QR Code JIS X 0510 Generation In Visual Studio .NET
Using Barcode generator for VS .NET Control to generate, create QR Code image in .NET framework applications.
function Remove-SPList([string]$url) { # Use the Get-SPList function to retrieve a list $spList = Get-SPList -url $url
Denso QR Bar Code Decoder In VS .NET
Using Barcode recognizer for Visual Studio .NET Control to read, scan read, scan image in Visual Studio .NET applications.
Bar Code Creator In Visual Studio .NET
Using Barcode creation for .NET framework Control to generate, create bar code image in Visual Studio .NET applications.
PowerShell for Microsoft SharePoint 2010 Administrators
Decode Bar Code In .NET Framework
Using Barcode reader for Visual Studio .NET Control to read, scan read, scan image in Visual Studio .NET applications.
Making QR-Code In C#
Using Barcode drawer for Visual Studio .NET Control to generate, create Quick Response Code image in .NET framework applications.
if($spList) { $spListDelete(); } }
Drawing Quick Response Code In .NET
Using Barcode printer for ASP.NET Control to generate, create QR Code 2d barcode image in ASP.NET applications.
QR Code 2d Barcode Creation In Visual Basic .NET
Using Barcode printer for Visual Studio .NET Control to generate, create QR Code 2d barcode image in VS .NET applications.
Run the Remove-SPList function as follows:
Print Linear Barcode In Visual Studio .NET
Using Barcode drawer for Visual Studio .NET Control to generate, create Linear Barcode image in .NET framework applications.
GS1 DataBar Stacked Drawer In VS .NET
Using Barcode printer for .NET Control to generate, create DataBar image in .NET applications.
PS > Remove-SPList -url "http://nimaintranet/site/Lists/My Calendar"
UPCA Generation In Visual Studio .NET
Using Barcode maker for .NET framework Control to generate, create UPC A image in .NET applications.
Generate British Royal Mail 4-State Customer Barcode In Visual Studio .NET
Using Barcode creator for .NET framework Control to generate, create Royal Mail Barcode image in .NET framework applications.
NOTE Lists in SharePoint 2010 have other properties that you can manipulate using Windows PowerShell You can use the Get-Member cmdlet to find out more about the available methods and properties of the SPList class
Generating ECC200 In Java
Using Barcode generator for Android Control to generate, create Data Matrix 2d barcode image in Android applications.
Create DataMatrix In None
Using Barcode maker for Office Word Control to generate, create ECC200 image in Word applications.
Managing SharePoint Fields
EAN / UCC - 13 Generation In .NET
Using Barcode maker for Reporting Service Control to generate, create UCC-128 image in Reporting Service applications.
Encode Code 3 Of 9 In None
Using Barcode printer for Font Control to generate, create Code39 image in Font applications.
You can also add fields to lists using Windows PowerShell You can display the available types of fields using the FieldTypeDefinitionCollection property of the SPWeb class In the following example, we send the output through a pipeline to the Select-Object cmdlet and display the TypeName and TypeDisplayName properties
Decode ANSI/AIM Code 128 In VB.NET
Using Barcode recognizer for Visual Studio .NET Control to read, scan read, scan image in VS .NET applications.
Reading Code 128 Code Set B In None
Using Barcode reader for Software Control to read, scan read, scan image in Software applications.
PS > $spWebFieldTypeDefinitionCollection | >> Select-Object -Property TypeName, TypeDisplayName TypeName -------Counter Text Note Choice MultiChoice GridChoice Integer Number Decimal Currency DateTime Lookup Boolean User URL TypeDisplayName --------------Counter Single line of text Multiple lines of text Choice Choice Rating Scale Integer Number Decimal Currency Date and Time Lookup Yes/No Person or Group Hyperlink or Picture
Draw Code 3/9 In None
Using Barcode encoder for Software Control to generate, create Code 39 Full ASCII image in Software applications.
Print ANSI/AIM Code 39 In Objective-C
Using Barcode drawer for iPad Control to generate, create Code 3 of 9 image in iPad applications.
Here, we ve shown only a fraction of the field types available in SharePoint 2010
14:
Working with SharePoint Lists
Creating a New Field
Before we add a field to a list, we first retrieve the list using the Get-SPList function
PS > $spList = Get-SPList -url "http://nimaintranet/site/Lists/My Custom List"
To create a field in a SharePoint 2010 list, you use the Add method provided by the SPFieldCollection class Here, we create a simple Text type field in a SharePoint list:
PS > $spFieldType = [MicrosoftSharePointSPFieldType]::Text PS > $spListFieldsAdd("TextField",$spFieldType,$false)
In this example, we create an SPFieldType object with the value Text and store it in the variable spFieldType We then use the Add method and pass in the field s display name, followed by the variable spFieldType, followed by Boolean False The last parameter in this overload of the Add method specifies whether the new field is required to always contain a value Our example creates a new text field in the list with the display name of TextField that will not require any input An additional Boolean parameter you can use with the Add method compacts the field name to eight characters if set to True The following wraps the field-creation code in a reusable function
function New-SPTextField([string]$url, [string]$field,[switch]$required) { # Use the Get-SPList function to retrieve a list $spList = Get-SPList -url $url if($spList) { $spFieldType = [MicrosoftSharePointSPFieldType]::Text $spListFieldsAdd($field, $spFieldType, $required) } }
Here s an example of using this function to create a new mandatory text field named My Field, in the My Custom List list:
PS > New-SPTextField -url "http://nimaintranet/site/Lists/My Custom List" ` >> -field "My Field" -required
A field in SharePoint 2010 has a few properties that you can set to change how the field is displayed Before you can change the properties of a field, you need to retrieve it You can either use the GetField method provided by the SPFieldCollection class or simply index into the collection
PS > $spField = $spListFieldsGetField("My Field") PS > $spField = $spListFields["My Field"]
The first example demonstrates how to use the GetField method to retrieve an existing field and store the object in a variable The second example demonstrates how to index into the collection Note that both forms are case-sensitive
PowerShell for Microsoft SharePoint 2010 Administrators
You can use the Get-Member cmdlet to display all the methods and properties available on the object
PS > $spField | Get-Member
Many of the properties available are get/set, meaning that you can get the values from the properties and set new values Here s how to set a description for the field:
PS > $spFieldDescription = "A Simple Text Field"
It is also possible to hide the field from various forms in SharePoint In the next example, we hide the field from the Edit Item form so that when end users try to edit a list item in SharePoint 2010, they will not be able to edit the text field, since it will simply not appear
PS > $spFieldShowInEditForm = $false PS > $spFieldUpdate()
We call the Update method to commit the changes to the SharePoint 2010 content database You can add other types of fields as well, such as Note, Number, Decimal, Currency, and so on Here is an example on adding an Integer type field using Windows PowerShell:
PS > $spFieldType = [MicrosoftSharePointSPFieldType]::Integer PS > $spListFieldsAdd("NumericField", $spFieldType, $false)
Copyright © OnBarcode.com . All rights reserved.