param($installPath, $toolsPath, $package, $project)
try {
    # Set up varibles
    $date = Get-Date
    $timestamp = $date.Year.ToString() + $date.Month.ToString() + $date.Day.ToString() + $date.Hour.ToString() + $date.Minute.ToString() + $date.Second.ToString()
    $connectionString ="Data Source=.\SQLEXPRESS;Initial Catalog=aspnet-$($project.ProjectName)-$timestamp;Integrated Security=True"
    $config = $project.ProjectItems | Where-Object { $_.Name -eq "Web.config" }    
    $fileName = $config.Properties | Where-Object { $_.Name -eq "FullPath" }
    
    #Load the Config File
    $xml = New-Object System.Xml.XmlDocument
    $xml.PreserveWhitespace = $true
    $xml.Load($fileName.Value)
    
    # Change the Connection string
    $xml.configuration.connectionstrings.selectsinglenode("add[@name='DefaultConnection']").connectionString = $connectionString
    
    # Save the Config File 
    $xml.Save($fileName.Value)
} catch {
    Write-Output "You will need to manually, change the 'Initial Catalog' in the 'DefaultConnection' to a unique name."
}
# SIG # Begin signature block
# MIIXcgYJKoZIhvcNAQcCoIIXYzCCF18CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUaoZ0S96GkkbtsZF246bxTq8k
# 9OWgghIxMIIEYDCCA0ygAwIBAgIKLqsR3FD/XJ3LwDAJBgUrDgMCHQUAMHAxKzAp
# BgNVBAsTIkNvcHlyaWdodCAoYykgMTk5NyBNaWNyb3NvZnQgQ29ycC4xHjAcBgNV
# BAsTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEhMB8GA1UEAxMYTWljcm9zb2Z0IFJv
# b3QgQXV0aG9yaXR5MB4XDTA3MDgyMjIyMzEwMloXDTEyMDgyNTA3MDAwMFoweTEL
# MAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1v
# bmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3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