Skip to content

Commit b1a6883

Browse files
bit more demoig [no ci]
1 parent 8383d7e commit b1a6883

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

developing/Oslo Demo.ps1

+27-8
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,47 @@ $cred = New-Object -TypeName System.Management.Automation.PSCredential -Argument
99
$show = 'All'
1010
#endregion
1111

12+
#region What do we have?
13+
14+
Get-DbaDatabase -SqlInstance $Sqlinstances -SqlCredential $cred -ExcludeSystem | Select-Object Sqlinstance, DatabaseName, Status
15+
16+
Get-DbaAgentJob -SqlInstance $Sqlinstances -SqlCredential $cred | Select-Object Sqlinstance, Name, Enabled
17+
#end region
18+
19+
Get-DbaLastBackup -SqlInstance $Sqlinstances -SqlCredential $cred | Select-Object Sqlinstance, Database, LastFullBackup | Format-Table
20+
1221
# lets run a couple of tests
1322

14-
Invoke-DbcCheck -SqlInstance $Sqlinstances -SqlCredential $cred -Check InstanceConnection, DatabaseStatus -legacy $true -Show $show
23+
# this one shows that the old existing code will work
24+
# the legacy switch is set to true by default
25+
26+
Invoke-DbcCheck -SqlInstance $Sqlinstances -SqlCredential $cred -Check InstanceConnection, DatabaseStatus -Show $show
1527

16-
# that failed but shouldnt have - set config
28+
# So lets show the shiny new faster code - legacy switch set to false
29+
30+
Invoke-DbcCheck -SqlInstance $Sqlinstances -SqlCredential $cred -Check InstanceConnection, DatabaseStatus -Show $show -legacy $false
31+
32+
33+
# The Authentication check failed but we would like to pass - lets set config
1734
Set-DbcConfig -Name policy.connection.authscheme -Value SQL
1835

1936
# run again
2037

21-
# what about skips?
38+
Invoke-DbcCheck -SqlInstance $Sqlinstances -SqlCredential $cred -Check InstanceConnection, DatabaseStatus -Show $show -legacy $false
39+
40+
# 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!!
2241
Set-DbcConfig -Name skip.connection.remoting -Value $true
2342

2443
# run again
2544

26-
# ok now in v5 mode
27-
Invoke-DbcCheck -SqlInstance $Sqlinstances -SqlCredential $cred -Check InstanceConnection, DatabaseStatus -legacy $false -Show $show
45+
Invoke-DbcCheck -SqlInstance $Sqlinstances -SqlCredential $cred -Check InstanceConnection, DatabaseStatus -Show $show -legacy $false
2846

29-
# So much quicker !!!
47+
# 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.
3048

31-
# show our perf test ????
49+
# This is how we know - We perf test our PowerShell code
50+
# This will take about 80-100 seconds to run so run first then talk!
3251

33-
$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'
52+
$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'
3453

3554
Invoke-PerfAndValidateCheck -Checks $Checks
3655

0 commit comments

Comments
 (0)