Skip to content

Commit

Permalink
Set-DbaStartupParameter - getting 1.0 ready (#5298)
Browse files Browse the repository at this point in the history
* Merge pull request #5157 from SQLGB/patch-1

Update Get-DbaAgentJobHistory.ps1

* format, add catch for call to get cmd

* change parameter to singular

* correct parameter names in test

* updating parameter reference

* adjust appveyor reference

* quick fix for copy startup proc

format and spelling
  • Loading branch information
wsmelton authored and potatoqualitee committed Mar 25, 2019
1 parent 2bb013c commit 9a3931d
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 121 deletions.
12 changes: 6 additions & 6 deletions functions/Copy-DbaStartupProcedure.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function Copy-DbaStartupProcedure {
Login to the target instance using alternative credentials. Windows and SQL Authentication supported. Accepts credential objects (Get-Credential)
.PARAMETER Procedure
The startup procedure(s) to process. This list is auto-populated from the server. If unspecified, all startup procedrues will be processed.
The startup procedure(s) to process. This list is auto-populated from the server. If unspecified, all startup procedures will be processed.
.PARAMETER ExcludeProcedure
The startup procedure(s) to exclude. This list is auto-populated from the server.
Expand Down Expand Up @@ -89,7 +89,7 @@ function Copy-DbaStartupProcedure {
try {
$sourceServer = Connect-SqlInstance -SqlInstance $Source -SqlCredential $SourceSqlCredential -MinimumVersion 9
} catch {
Stop-Function -Message "Error occurred while establishing connection to $instance" -Category ConnectionError -ErrorRecord $_ -Target $Source
Stop-Function -Message "Error occurred while establishing connection to $Source" -Category ConnectionError -ErrorRecord $_ -Target $Source
return
}
# Includes properties: Name, Schema (both as strings)
Expand Down Expand Up @@ -163,9 +163,9 @@ function Copy-DbaStartupProcedure {
$sql = $header + $body
Write-Message -Level Verbose -Message $sql
$null = Invoke-DbaQuery -SqlInstance $destServer -Query $sql -Database master -EnableException
$startupsql = "EXEC SP_PROCOPTION '$currentProcName', 'STARTUP', 'ON'"
Write-Message -Level Verbose -Message $startupsql
$null = Invoke-DbaQuery -SqlInstance $destServer -Query $startupsql -Database master -EnableException
$startupSql = "EXEC SP_PROCOPTION '$currentProcName', 'STARTUP', 'ON'"
Write-Message -Level Verbose -Message $startupSql
$null = Invoke-DbaQuery -SqlInstance $destServer -Query $startupSql -Database master -EnableException

$copyStartupProcStatus.Status = "Successful"
$copyStartupProcStatus | Select-DefaultView -Property DateTime, SourceServer, DestinationServer, Name, Type, Status, Notes -TypeName MigrationObject
Expand All @@ -178,4 +178,4 @@ function Copy-DbaStartupProcedure {
}
}
}
}
}
Loading

0 comments on commit 9a3931d

Please sign in to comment.