SharePoint, as is the practice, understandably, takes a while to adopt and use the latest; the Sharepoint snapin and cmdlets comes with the 2010 release.
It should ideally be bye-bye time to stsadm command now. If not it is a good excuse to create your own custom cmdlet
For new users, it will take a while to get an idea of the power of Powershell; here are a set of tips for finding your way around and getting comfortable with using it
A couple of useful commands that comes in handy everytime for me are get-command and get-help.
Note: if you donot find SP after the hyphen then the cmdlet is not a SharePoint cmdlet and most probably it is available as cmdlet in Windows Poweshell
Let us take the scenario where you have created a farm solution (not sandbox, with 2010 we have to be clearer :)) and is planning to add that to your environment. Do not use stsadm -o addsolution however tempting it turns out to be - look for the corresponding powershell cmdlet
Tip #1: Use Get-Command with wildcards:
You know for sure that cmdlet name will solution, so search for it in SharePoint management shell with
Get-Command *solution*
Tip #2: Use Get-Command with specific command
Now that you have go the cmdlet look closer at to what is its syntax
Get-Command Add-SPSolution
Tip #3: Use Get-Help with specific command
Get Help is another command you can use, which will say in words and through description (surprisingly good documentation) what the command is all about
Get-Help Add-SPSolution
Tip #4: Use Get-Help with examples switch
In case you need to see some examples on how the command has to be used go for examples switch.
Get-Help Add-SPSolution -examples
Finally, go ahead and add the solution
You would like the output it gives, right :) Now try to find out how to deploy the solution through cmdlet. Don't be surprised by the output that cmdlet gives (:()
Note: good time to familiarize yourself with the term switch. In powershell there are 3 terminologies used for specifying the inputs to a cmdlet
Parameter : parameter is the name of the cmdlet property for which a value is provided (for e.g. in the Add-SPSolution cmdlet call LiteralPath is a parameter)
Argument : The value that is passed to the parameter (for e.g. in the Add-SPSolution cmdlet call the physical path of the wsp file is the argument)
Switch : the parameter that does not need an argument (for e.g. in the Get-Help cmdlet examples is a switch, imagine turning on a switch and a behavior gets added to the cmdlet)
2 comments:
The get-command gives a syntax which is pretty lengthy and not too understandable
typing master pro crack
easeus partition master key
lumion pro full crack
ccleaner crack
gladiator vst crack
lumion pro crack
disk drill crack
malwarebytes crack
driver easy pro crack
virtual dj crack
Post a Comment