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

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

SPBG User Group meeting about FAST Search in SharePoint 2010

The 14th of January the Danish SharePoint User Group holds a ERFA meeting about FAST Search in SharePoint 2010. Read more there in Danish