diff --git a/containers/JessAndBeard.psm1 b/containers/JessAndBeard.psm1 index 853c79ab..a37c5631 100644 --- a/containers/JessAndBeard.psm1 +++ b/containers/JessAndBeard.psm1 @@ -2304,8 +2304,9 @@ New Code runs in {2} % of the time Write-PSFMessage -Message $savingMessage -Level Output ##validate we got the right answers too - - If (Compare-Object $v5code.Configuration.Filter.Tag.Value $v4code.TagFilter) { +[System.Collections.ArrayList]$v5CodeTags = $v5code.Configuration.Filter.Tag.Value +$v5CodeTags.Remove('FailedConnections') + If (Compare-Object $v5CodeTags $v4code.TagFilter) { $Message = " Uh-Oh - The Tag filters between v4 and v5 are not the same somehow. For v4 We returned @@ -2420,7 +2421,12 @@ For v4 We Passed and For v5 we Passed {1} tests -{2}" -f $v4code.PassedCount, $v5Passed, $messageAppend +{2} +v4 TestNames +{3} +v5 TestNames +{4} +" -f $v4code.PassedCount, $v5Passed, $messageAppend, ($v4code.TestResult.Where{$_.Result -eq 'Passed'}.Name |Out-String),($v5code.Passed.ExpandedName |Out-String) Write-PSFMessage -Message $Message -Level Warning } else { $message = " @@ -2437,7 +2443,11 @@ For v4 We Failed and For v5 we Failed {1} tests -" -f $v4code.FailedCount, $v5failed +v4 TestNames +{2} +v5 TestNames +{3} +" -f $v4code.FailedCount, $v5failed,($v4code.TestResult.Where{$_.Result -eq 'Failed'}.Name |Out-String),($v5code.Failed.ExpandedName |Out-String) Write-PSFMessage -Message $Message -Level Warning } else { $message = " @@ -2453,8 +2463,12 @@ For v4 We Skipped {0} tests and For v5 we Skipped -{1} tests -{2}" -f $v4code.SkippedCount, $v5skipped, $messageAppend +{1} +v4 TestNames +{3} +v5 TestNames +{4} +{2}" -f $v4code.SkippedCount, $v5skipped, $messageAppend,($v4code.TestResult.Where{$_.Result -eq 'Skipped'}.Name |Out-String),($v5code.Skipped.ExpandedName |Out-String) Write-PSFMessage -Message $Message -Level Warning } else { $message = " diff --git a/containers/base/profile.ps1 b/containers/base/profile.ps1 index 63b6374e..51c82d35 100644 --- a/containers/base/profile.ps1 +++ b/containers/base/profile.ps1 @@ -59,8 +59,8 @@ function Load-Profile { ) $global:__currentTheme = (Get-Random -InputObject $themes) function global:Get-CurrentPoshTheme { $__currentTheme } - Set-PoshPrompt -Theme $__currentTheme - + # Set-PoshPrompt -Theme $__currentTheme + Set-PoshPrompt -Theme 'chips' if ($psstyle) { $psstyle.FileInfo.Directory = $psstyle.FileInfo.Executable = $psstyle.FileInfo.SymbolicLink = "" $PSStyle.FileInfo.Extension.Clear() diff --git a/developing/Oslo Demo.ps1 b/developing/Oslo Demo.ps1 index cd9c6f3c..0c0ca180 100644 --- a/developing/Oslo Demo.ps1 +++ b/developing/Oslo Demo.ps1 @@ -9,28 +9,47 @@ $cred = New-Object -TypeName System.Management.Automation.PSCredential -Argument $show = 'All' #endregion +#region What do we have? + +Get-DbaDatabase -SqlInstance $Sqlinstances -SqlCredential $cred -ExcludeSystem | Select-Object Sqlinstance, DatabaseName, Status + +Get-DbaAgentJob -SqlInstance $Sqlinstances -SqlCredential $cred | Select-Object Sqlinstance, Name, Enabled +#end region + +Get-DbaLastBackup -SqlInstance $Sqlinstances -SqlCredential $cred | Select-Object Sqlinstance, Database, LastFullBackup | Format-Table + # lets run a couple of tests -Invoke-DbcCheck -SqlInstance $Sqlinstances -SqlCredential $cred -Check InstanceConnection, DatabaseStatus -legacy $true -Show $show +# this one shows that the old existing code will work +# the legacy switch is set to true by default + +Invoke-DbcCheck -SqlInstance $Sqlinstances -SqlCredential $cred -Check InstanceConnection, DatabaseStatus -Show $show -# that failed but shouldnt have - set config +# So lets show the shiny new faster code - legacy switch set to false + +Invoke-DbcCheck -SqlInstance $Sqlinstances -SqlCredential $cred -Check InstanceConnection, DatabaseStatus -Show $show -legacy $false + + +# The Authentication check failed but we would like to pass - lets set config Set-DbcConfig -Name policy.connection.authscheme -Value SQL # run again -# what about skips? +Invoke-DbcCheck -SqlInstance $Sqlinstances -SqlCredential $cred -Check InstanceConnection, DatabaseStatus -Show $show -legacy $false + +# Hmmm, we know that we will never be able to remote onto these containers so let talk about skipping. No Claudio not that sort of skipping!! Set-DbcConfig -Name skip.connection.remoting -Value $true # run again -# ok now in v5 mode -Invoke-DbcCheck -SqlInstance $Sqlinstances -SqlCredential $cred -Check InstanceConnection, DatabaseStatus -legacy $false -Show $show +Invoke-DbcCheck -SqlInstance $Sqlinstances -SqlCredential $cred -Check InstanceConnection, DatabaseStatus -Show $show -legacy $false -# So much quicker !!! +# So much quicker !!! OK for one check it will be slower. For two it will probably be about the same but for 3 or more it will be quicker. Much quicket. Exrapolate that to 100 checks and a 1000 instances you can see the difference. -# show our perf test ???? +# This is how we know - We perf test our PowerShell code +# This will take about 80-100 seconds to run so run first then talk! -$Checks = 'ErrorLogCount', 'XESessionExists', 'XESessionStopped', 'XpCmdShellDisabled', 'WhoIsActiveInstalled', 'CLREnabled', 'TwoDigitYearCutoff', 'MaxDopInstance', 'ErrorLogCount', 'ModelDbGrowth', 'DefaultBackupCompression', 'SaExist', 'SaDisabled', 'SaRenamed', 'DefaultFilePath', 'AdHocDistributedQueriesEnabled', 'AdHocWorkload', 'DefaultTrace', 'OleAutomationProceduresDisabled', 'CrossDBOwnershipChaining', 'ScanForStartupProceduresDisabled', 'RemoteAccessDisabled', 'SQLMailXPsDisabled', 'DAC', 'OLEAutomation', 'ServerNameMatch', 'OrphanedFile', 'MaxMemory', 'NetworkLatency', 'PublicPermission' +$Checks = 'ErrorLogCount', 'XpCmdShellDisabled', 'WhoIsActiveInstalled', 'CLREnabled', 'TwoDigitYearCutoff', 'MaxDopInstance', 'ErrorLogCount', 'ModelDbGrowth', 'DefaultBackupCompression', 'SaExist', 'SaDisabled', 'SaRenamed', 'DefaultFilePath', 'AdHocDistributedQueriesEnabled', 'AdHocWorkload', 'DefaultTrace', 'OleAutomationProceduresDisabled', 'CrossDBOwnershipChaining', 'ScanForStartupProceduresDisabled', 'RemoteAccessDisabled', 'SQLMailXPsDisabled', 'DAC', 'OLEAutomation', 'ServerNameMatch', 'OrphanedFile', 'MaxMemory', 'PublicPermission' Invoke-PerfAndValidateCheck -Checks $Checks