WEBSITE

Sharepoint 2013 : PowerShell Basics (part 1)

10/10/2013 4:22:50 AM

What Is a Cmdlet?

PowerShell commands are called cmdlets. They are structured by a verb and noun concatenation in the form of verb-noun. So in the cmdlet Get-Help, Get is the verb and Help is the noun.


Tip

Use the Get-Help cmdlet to view helpful information about working with cmdlets.

How Can I See the Possible Verbs for a Noun Command?

If you know the noun but are unsure of the possible verbs available, you can enter the noun with -? to display the available verb-noun combinations. This also displays additional nouns that are similar to the one you provided. For example, SPSite -? displays the available verbs not only for the SPSite noun, but also for SPSiteAdministration, SPSiteSubscription, and other cmdlets available beginning with SPSite.

What Is a Parameter?

Most cmdlets need values to perform the desired actions. These values are provided to the cmdlet using parameters in the following form:

-parametername <value>

What Is a Switch Parameter?

A switch parameter is a parameter used with a cmdlet that does not take a value (or that is Boolean in nature and can be set to a false setting). The fact that the switch parameter is present “switches on” that option (true setting) when executing the cmdlet.

Most of the time, switch parameters are optional, but in some cases, you need to provide a switch. This depends on the cmdlet being executed.

How Can I See the Possible Parameters for a Cmdlet?

Entering the cmdlet in the console with -? as a parameter displays information about that cmdlet, along with the available parameters. Listing 1 shows an example.

Listing 1. Getting Information About a Cmdlet


Get-SPSite -?


Some cmdlets, such as Get-SPSite, have different variations of parameters. These variations also are displayed within the information provided by the -? parameter, as Figure 1 shows.

Image

Figure 1. Using -? with a cmdlet provides various syntax information.

What Does F3 Do?

Pressing the F3 function key in the console window displays the last-executed statement on the current prompt line. Using the up and down arrows, you can page through the other previous statements. This is useful for repeating or correcting previous command entries. Use the left and right arrow keys to place the cursor within the command text for corrections.


Tip

Pressing the Insert key on the keyboard allows you to overwrite text within the command text without pushing the text out.

What Does F7 Do?

This is probably the best-kept secret in command consoles. Every time I show this to someone, they say they had no idea it was available. If you have been entering several commands in a console screen, pressing the F7 function key displays a menu of the previously executed commands, as Figure 2 shows.

Image

Figure 2. Pressing the F7 function key presents a command history menu.

Use the arrow keys to change the selection in the menu. Pressing Enter executes the command selected. Pressing F9 on the menu enables you to enter the command number you want to re-execute but only places it on the line (the command is not executed automatically).


Other  
  •  SharePoint 2013 Management Shell : What Is the SharePoint 2013 Management Shell Loading?
  •  Watch Web TV Anywhere (Part 3)
  •  Watch Web TV Anywhere (Part 2)
  •  Watch Web TV Anywhere (Part 1)
  •  YouView brings The Most Extraordinary Way To Watch TV (Part 2)
  •  YouView brings The Most Extraordinary Way To Watch TV (Part 1)
  •  Installing and Configuring SharePoint 2013 : Creating Web Applications and More
  •  Installing and Configuring SharePoint 2013 : Creating the Farm (part 7) - Configuring the App Management Service - Configuring the User Profile Service
  •  Installing and Configuring SharePoint 2013 : Creating the Farm (part 6) - Configuring the App Management Service - Configuring PerformancePoint Services , Configuring the Search Service Application
  •  Installing and Configuring SharePoint 2013 : Creating the Farm (part 5) - Configuring the App Management Service - Configuring the Managed Metadata Service
  •  
    Top 10
    Review : Sigma 24mm f/1.4 DG HSM Art
    Review : Canon EF11-24mm f/4L USM
    Review : Creative Sound Blaster Roar 2
    Review : Philips Fidelio M2L
    Review : Alienware 17 - Dell's Alienware laptops
    Review Smartwatch : Wellograph
    Review : Xiaomi Redmi 2
    Extending LINQ to Objects : Writing a Single Element Operator (part 2) - Building the RandomElement Operator
    Extending LINQ to Objects : Writing a Single Element Operator (part 1) - Building Our Own Last Operator
    3 Tips for Maintaining Your Cell Phone Battery (part 2) - Discharge Smart, Use Smart
    REVIEW
    - First look: Apple Watch

    - 3 Tips for Maintaining Your Cell Phone Battery (part 1)

    - 3 Tips for Maintaining Your Cell Phone Battery (part 2)
    VIDEO TUTORIAL
    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 1)

    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 2)

    - How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 3)
    Popular Tags
    Video Tutorail Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Exchange Server Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe Photoshop CorelDRAW X5 CorelDraw 10 windows Phone 7 windows Phone 8 Iphone