Tuesday, February 9, 2010

A CodePlex project worth following.

A friend, Malthe Stougaard, tip me at the last SharePoint Dinner of a new CodePlex project worth following. The project exists of a group of SharePoint MVPs that create a collection of useful SharePoint 2010 Visual Studio 2010 Extensions. The project is still in an alpha release, but all ready now the project contains:

  • New item templates
    • Custom Action (basic)
    • Hide Custom Action (basic)
    • Custom Action Group (basic)
    • Delegate Control (basic)
  • Deployment
    • Restart IIS
    • Recycle app pools
    • Copy to SharePoint root
    • Auto GAC
    • Auto copy to root
    • Attach to worker process
  • Server Explorer extensions
    • Web part gallery listing
    • Import Content Type into current project (stub - full feature to come in beta)
    • Display Custom Action Groups (stub - full feature to come in beta)
    • Display Custom Actions (stub - full feature to come in beta)
    • Display Hide Custom Actions (stub - full feature to come in beta)

So time to play with some VS.net extensions :)

Thursday, February 4, 2010

SharePoint User Group Meeting

The 4th of March will the Danish SharePoint User Group (SPBG) organize a user group meeting, about business intelligence and SharePoint 2010 Insight. Read more here (in Danish)

Wednesday, January 6, 2010

SharePoint Dinner in Copenhagen, February the 4th

The danish SharePoint user group (SPBG) organise SharePoint dinner in Copenhagen February the 4th at 18 o’clock. Read more about it on SPBGs homepage. (link to the dinner event)

Tuesday, January 5, 2010

Set developer dashboard level with PowerShell

To set the developer dashboard level with PoweShell, open the SharePoint 2010 Management Shell Console and run this lines.

#SPDeveloperDashboardLevel is On, Off or OnDemand
$contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$contentService.DeveloperDashboardSettings.DisplayLevel = ([Enum]::Parse([Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel], 'OnDemand'))
$contentService.DeveloperDashboardSettings.Update()

Relate post “SharePoint 2010 - Developer dashboard

Monday, January 4, 2010

PowerShell Console shortcuts

Key

Action

(Alt)+(F7)

Deletes the current command history

(PgUp), (PgDn)

Display the first (PgUp) or last (PgDn) command you used in current session

(Enter)

Send the entered lines to PowerShell for execution

(End)

Moves the editing cursor to the end of the command line

(Del)

Deletes the character to the right of the insertion point

(Esc)

Deletes current command line

(F2)

Moves in current command line to the next character corresponding to specified character

(F4)

Deletes all characters to the right of the insertion point up to specified character

(F7)

Displays last entered commands in a dialog box

(F8)

Displays commands from command history beginning with the character that you already entered in the command line

(F9)

Opens a dialog box in which you can enter the number of a command from your command history to return the command. (F7) displays numbers of commands in command history

(Left arrow), (Right arrow)

Move one character to the left or right respectively

(Arrow up), (Arrow down), (F5), (F8)

Repeat the last previously entered command

(Home)

Moves editing cursor to beginning of command line

(Backspace)

Deletes character to the left of the insertion point

(Ctrl)+(C)

Cancels command execution

(Ctrl)+(End)

Deletes all characters from current position to end of command line

(Ctrl)+(Arrow left), (Ctrl)+(Arrow right)

Move insertion point one word to the left or right respectively

(Ctrl)+(Home)

Deletes all characters of current position up to beginning of command line

(Tab)

Automatically completes current entry, if possible

Sunday, January 3, 2010

Live Online SharePoint Saturday EMEA

On January 23rd, 2010, is the first online SharePoint Saturday event hold. Read more here (in Danish)

Friday, January 1, 2010

How to test if a solution is added to the solution store with PowerShell?

To get the full list of SharePoint solution that is added to the solution store, you can run Get-SPSolution. To just get one solution you can provide Get-SPSolution with a -Identity <SPSolutionPipeBind> . SPSolutionPipeBind is the name for the solution. e.g. Get-SPSolution mySolution.wsp. But if solution is not in the solution store it will throw an exception.

PS C:\Users\andersd> Get-SPSolution mysolution.wsp
Get-SPSolution : Cannot find an SPSolution object with Id or Name: mysolution.wsp.
At line:1 char:15
+ Get-SPSolution <<<< mysolution.wsp
+ CategoryInfo : InvalidData: (Microsoft.Share...dletGetSolution:
SPCmdletGetSolution) [Get-SPSolution], SPCmdletPipeBindException
+ FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletGetSolution

This is not useful at all. So let’s back track a bit. We know the Get-SPSolution return a list of solution that can be piped. So if we pipe the list with Where-Object, alias Where, like is Get-SPSolution | Where { $_.Name -eq "mysolution.wsp" } we will get a solution object if it is found, if not then we get a null object that we can test for insted. The last thing is to wrap this in a function like is

function IsFarmSolutionAddToSolutionStore([string] $WSPName) {
    $WSP = Get-SPSolution | Where { 
        ($WSPName -eq $_.Name) 
    } 
    if($WSP -eq $null) { 
        return [Bool]0 
    } 
    else { 
        return [Bool]1
    }
}

And we can use it like this

PS C:\Users\andersd> Write-Host "is solution added" | IsFarmSolutionAddToSolutionStore("mysolution.wsp")
is solution added
True