Sign In
 
 
Go Search
 
Zach Rosenfield's SharePoint Blog > Posts > Navigating STSADM with PowerShell
Navigating STSADM with PowerShell

Just a quick post this week to help out those of you can never remember the exact STSADM command to use. I personally find the '-help' output to be too long to really be useful—so instead I leverage the where statement in PowerShell to find relevant command for whatever I'm doing. For example, when working with SharePoint Solutions I'll first execute this command to see my options (*NOTE: I've created an alias "stsadm" for calling the STSADM.exe application directly):

PS> stsadm -help |where{$_ -like "*solution*"}

addsolution
deletesolution
deploysolution
displaysolution
enumsolutions
removesolutiondeploymentlock
retractsolution
syncsolution
upgradesolution

Leveraging the wildcard match allows you to quickly locate the right command for your needs. I've added this little script to my $PROFILE to quickly reference STSADM commands:

function global:Get-StsadmCmd($in){

Write-Host -foreground "Yellow" "STSADM commands matching $in"

stsadm -help |where{$_ -like $in}

}

Now, for example, I can find Feature related commands by simply typing Get-StsadmCmd "*features*".

Comments

Here's another cool PS trick with STSADM

You can use PowerShell to parse the output of stsadm -o enumsolutions so you can easily see if a WSP install went OK or not.
On my blog at http://blumenthalit.net/blog/Lists/Posts/Post.aspx?ID=43
at 5/2/2008 8:45 AM

Add Comment

Items on this list require content approval. Your submission will not appear in public views until approved by someone with proper rights. More information on content approval.

Title


Comments *


Name (required) *


Attachments
 
 
   
Real Time Web Analytics