What Each Product Backlog Item (PBI) State Means to You.

New – These are PBIs that someone has added to the product backlog and have not been reviewed by the product owner and have not been agreed to build.

Approved – These are PBIs that the product owner has agreed with, edited and made sure they are understandable for the team. Once approved they are ready for the team to pick up in sprint planning.

Committed – A Scrum team has discussed the PBI in sprint planning, created some tasks and agreed to do build the PBI in the current sprint.

Done – In sprint review, the product owner inspects the work the team has done and if he/she agrees it meets the requirements and quality standards, then the item is moved to done.

PowerShell script to file browse, change file attribute, restore SharePoint site backup

Here is a nice little utility (written using PowerShell script) which I use to restore a site backup time to time.

Some features of this script are:

1. Displays a file browse dialog to select a file (see – Invoke-FileBrowser)

2. Removes the read-only attribute on the file (see – Remove-Readonly), this is required as the backup file is stored in TFS.

3. Restore a given backup file, without asking for confirmation (see – Restore-SPBackup)

——————————————————————————————————————————

$ErrorActionPreference = "Stop"

Add-PSSnapin Microsoft.SharePoint.PowerShell -EA 0

# Example:
# $file = Invoke-FileBrowser -Title "Select a file" -Directory "D:\backups" -Filter "Powershell Scripts|(*.ps1)"
function Invoke-FileBrowser
{
      param([string]$Title,[string]$Directory,[string]$Filter="All Files (*.*)|*.*")
      [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
      $FileBrowser = New-Object System.Windows.Forms.OpenFileDialog
      $FileBrowser.InitialDirectory = $Directory
      $FileBrowser.Filter = $Filter
      $FileBrowser.Title = $Title
      $Show = $FileBrowser.ShowDialog()
      If ($Show -eq "OK")
      {
            Return $FileBrowser.FileName
      }
      Else
      {
            Write-Error "Restore cancelled by user."
      }
}

# Example:
# Remove-Readonly -FilePath "D:\backups\filename.txt"
function Remove-Readonly
{
    param([string]$FilePath)
    #Remove read-only attribute, otherwise access denied error.
    Set-ItemProperty -Path $FilePath -name IsReadOnly -value $false
}

# Example:
# Restore-SPBackup -FilePath "D:\backups\backupfile.bak"
function Restore-SPBackup
{
    param([string]$BackupFilePath, [string]$WebUrl)
    #Restore the backup without asking for confirmation.
    Restore-SPSite -Identity $WebUrl -Path $BackupFilePath -Confirm:$false
}

$backupLocation = "C:\mywork\scm\JRCP.Internet\JRCP.Internet\JRCP Data Structures\Site Backups"
$SiteUrl = "http://sp2010riyaz:4040"

$file = Invoke-FileBrowser -Title "Browse" -Directory $backupLocation -Filter "All Files (*.*)|*.*"
Remove-Readonly -FilePath $file
Restore-SPBackup -BackupFilePath $file -WebUrl $SiteUrl
--------------------------------------------------------------------

Wait for more useful utilities…