You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ensure you are able to reproduce it on the latest released version (we release often)
Verified this bug is not already reported in an issue
Verified errors are not related to permissions
Can reproduce in a clean PowerShell session (clean = powershell -NoProfile)
If two or more templates are imported, they can't get the same name. In this case the warning should be shown.
if (($Path.Count -gt 1 -or $Template.Count -gt 1) -and (Test-Bound -ParameterName Template)) {
Stop-Function -Message "Name cannot be specified with multiple files or templates because the Session will already exist."
}
So the second part should be Test-Bound -ParameterName Name
The function continues anyway when the warning is shown. For me it makes more sense if the function just stops after the warning instead of just doing the job partly.
Steps to Reproduce
Case 1:
Import-DbaXESessionTemplate-SqlInstance .-Template 'Database Health 2016 and Above','Activity Tracking'
Case 2:
Import-DbaXESessionTemplate-SqlInstance .-Template 'Database Health 2016 and Above','Activity Tracking'-Name test
## Expected Behavior
The first case should not show the warning. The second case should show the warning:
"Name cannot be specified with multiple files or templates because the Session will already exist."## Actual Behavior
The first case shows the warning and the second case not.
## Environmental data<!-- Provide output of the following two commands -->- PowerShell:
Name Value
---------
PSVersion 5.1.14393.2636
PSEdition Desktop
PSCompatibleVersions {1.0,2.0,3.0,4.0...}
BuildVersion 10.0.14393.2636
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1-- SQL Server:
Microsoft SQL Server vNext (CTP2.0) -15.0.1000.34 (X64) Sep 18201810:18:13 Copyright (C) 2018 Microsoft Corporation Developer Edition (64-bit) on Windows Server 2016 Datacenter 10.0<X64> (Build 14393: ) (Hypervisor)
The text was updated successfully, but these errors were encountered:
Before submitting a bug report:
powershell -NoProfile
)If two or more templates are imported, they can't get the same name. In this case the warning should be shown.
So the second part should be Test-Bound -ParameterName Name
The function continues anyway when the warning is shown. For me it makes more sense if the function just stops after the warning instead of just doing the job partly.
Steps to Reproduce
The text was updated successfully, but these errors were encountered: