Skip to content

Commit

Permalink
Small fixes Import-DbaXESessionTemplate (#4917)
Browse files Browse the repository at this point in the history
* Update Import-DbaXESessionTemplate.ps1

* Update Import-DbaXESessionTemplate.ps1
  • Loading branch information
IJeb Reitsma authored and potatoqualitee committed Jan 11, 2019
1 parent d7cc612 commit c871fda
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions functions/Import-DbaXESessionTemplate.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ function Import-DbaXESessionTemplate {
Stop-Function -Message "You must specify Path or Template."
}

if (($Path.Count -gt 1 -or $Template.Count -gt 1) -and (Test-Bound -ParameterName Template)) {
if (($Path.Count -gt 1 -or $Template.Count -gt 1) -and (Test-Bound -ParameterName Name)) {
Stop-Function -Message "Name cannot be specified with multiple files or templates because the Session will already exist."
return
}

foreach ($instance in $SqlInstance) {
Expand Down Expand Up @@ -191,7 +192,7 @@ function Import-DbaXESessionTemplate {
}

try {
Write-Message -Level Verbose -Message "Importing $file as $name "
Write-Message -Level Verbose -Message "Importing $file as $Name "
$session = $store.CreateSessionFromTemplate($Name, $file)
$session.Create()
if ($file -eq $tempfile) {
Expand All @@ -204,4 +205,4 @@ function Import-DbaXESessionTemplate {
}
}
}
}
}

0 comments on commit c871fda

Please sign in to comment.