Skip to content
Permalink
Browse files

updates

  • Loading branch information
Tracy Boggiano Tracy Boggiano
Tracy Boggiano authored and Tracy Boggiano committed Nov 25, 2019
1 parent 4c4cb5e commit 83e09c475a95b9833f7c5b07b4b7b47563230505
@@ -0,0 +1,31 @@
name: PR-Pester

on:
pull_request:
branches:
- development

jobs:
build:

runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: Install and run Pester annoyingly on Windows PowerShell https://github.com/pester/Pester/issues/1295
run: |
$manifest = Import-PowershellDataFile -Path .\dbachecks.psd1
$PesterVersion = $manifest.RequiredModules.Where{$_.ModuleName -eq 'Pester'}.ModuleVersion
$PSFrameworkVersion = $manifest.RequiredModules.Where{$_.ModuleName -eq 'PSFramework'}.ModuleVersion
$dbatoolsVersion = $manifest.RequiredModules.Where{$_.ModuleName -eq 'dbatools'}.ModuleVersion
Install-Module Pester -RequiredVersion $PesterVersion -Force
Install-Module dbatools -RequiredVersion $dbatoolsVersion -Force
Install-Module PSFramework -RequiredVersion $PsFrameworkVersion -Force
Import-Module .\dbachecks.psd1
$PesterResults = Invoke-Pester .\tests -ExcludeTag Integration -Show Fails -PassThru
If($PesterResults.FailedCount -ne 0){
Write-Warning "Some Tests Failed - See results above"
[System.Environment]::Exit(1)
}
shell: powershell
@@ -1,3 +1,36 @@
## Date 25th November
Thank you Tracey tboggiano
Added new CIS Check for OLE AUtomation Procedures to be disabled #707

##Latest

## Date 16th November
Thank you Matt @matt2005
Removed rogue else from Agents Tests #713

## Date 17th October
Thank you Shane @SOZDBA
Improved Documentation
Thank you Gareth NewMan
Added New Check - Default File Path

## Date 1st October 2019
Thank you Rob
Fixed some merge issues with a load of code :-(
Created GitHub Action to run Pester Checks on PR
Thank you @TracyBoggiano
Added New Checks
RemoteAccessDisabled
ScanForStartUpProcedures
Thank you Gareth Newman
Improved wording in tests #700 , #697
Fix incorrect calculation in last agent run time #696 #698
Fixed bug in AllInstanceInfo
Thank you Richard Imenes
Fixed dead links in readme #702
Thank you Benjamin Schenk
Fixed Send-MailMessage in readme #705

## Date 30th July 2019
Thank you Rob ;-)
Added two new checks #239
@@ -8,8 +41,6 @@ Added four new configs
agent.longrunningjob.percentage
agent.lastjobruntime.percentage

##Latest

## Date 29th July 2019
Thank you @TracyBoggiano
Added tags for checks that will be part of CIS checks #642

Large diffs are not rendered by default.

@@ -196,6 +196,30 @@ $Tags = Get-CheckInformation -Check $Check -Group Instance -AllChecks $AllChecks
}
}

Describe "Default File Path" -Tags DefaultFilePath, $filename {
if ($NotContactable -contains $psitem) {
Context "Testing Default File Path on $psitem" {
It "Can't Connect to $Psitem" {
$false | Should -BeTrue -Because "The instance should be available to be connected to!"
}
}
}
else {
Context "Testing Default Data File Path on $psitem" {
It "Default Data File Path on $psitem" {
$diskFile = Get-DbaInstanceProperty -SqlInstance $psitem | Where-Object Name -eq DefaultFile
$diskFile.Value.substring(0,1) | Should -Not -Be "C" -Because 'Default Data file path should not be your C:\ drive'
}
}
Context "Testing Default Log File Path on $psitem" {
It "Default Log File Path on $psitem" {
$diskLog = Get-DbaInstanceProperty -SqlInstance $psitem | Where-Object Name -eq DefaultLog
$diskLog.Value.substring(0,1) | Should -Not -Be "C" -Because 'Dafault Log file path should not be your C:\ drive'
}
}
}
}

Describe "Dedicated Administrator Connection" -Tags DAC, CIS, Low, $filename {
$dac = Get-DbcConfigValue policy.dacallowed
if ($NotContactable -contains $psitem) {
@@ -796,6 +820,24 @@ $Tags = Get-CheckInformation -Check $Check -Group Instance -AllChecks $AllChecks
}
}
}

Describe "Scan For Startup Procedures" -Tags ScanForStartupProceduresDisabled, Security, CIS, Medium, $filename {
$skip = Get-DbcConfigValue skip.instance.scanforstartupproceduresdisabled
if ($NotContactable -contains $psitem) {
Context "Testing Scan For Startup Procedures on $psitem" {
It "Can't Connect to $Psitem" -Skip:$skip {
$false | Should -BeTrue -Because "The instance should be available to be connected to!"
}
}
}
else {
Context "Testing Scan For Startup Procedures on $psitem" {
It "Scan For Startup Procedures should be disabled on $psitem" -Skip:$skip {
Assert-ScanForStartupProcedures -AllInstanceInfo $AllInstanceInfo
}
}
}
}
Describe "Default Trace" -Tags DefaultTrace, CIS, Low, $filename {
$skip = Get-DbcConfigValue skip.instance.defaulttrace
if ($NotContactable -contains $psitem) {
@@ -813,7 +855,23 @@ $Tags = Get-CheckInformation -Check $Check -Group Instance -AllChecks $AllChecks
}
}
}

Describe "OLE Automation Procedures Disabled" -Tags OLEAutomationProceduresDisabled, CIS, Low, $filename {
$skip = Get-DbcConfigValue skip.instance.oleautomationproceduresdisabled
if ($NotContactable -contains $psitem) {
Context "Checking OLE Automation Procedures on $psitem" {
It "Can't Connect to $Psitem" -Skip:$skip {
$false | Should -BeTrue -Because "The instance should be available to be connected to!"
}
}
}
else {
Context "Checking OLE Automation Procedures on $psitem" {
It "The OLE Automation Procedures should be disabled on $psitem" -Skip:$skip {
Assert-OLEAutomationProcedures -AllInstanceInfo $AllInstanceInfo
}
}
}
}
Describe "Remote Access Disabled" -Tags RemoteAccessDisabled, Security, CIS, Medium, $filename {
$skip = Get-DbcConfigValue skip.instance.remoteaccessdisabled
if ($NotContactable -contains $psitem) {
@@ -11,7 +11,7 @@
RootModule = 'dbachecks.psm1'

# Version number of this module.
ModuleVersion = '1.2.11'
ModuleVersion = '1.2.16'

# ID used to uniquely identify this module
GUID = '578c5d98-50c8-43a8-bdbb-d7159028d7ac'
@@ -131,15 +131,11 @@

# Release notes for this particular version of the module
ReleaseNotes = "
## Date 30th July 2019
Thank you Rob ;-)
Added two new checks #239
LastJobRunTime and LongRunningJob
Added four new configs
skip.agent.longrunningjobs
skip.agent.lastjobruntime
agent.longrunningjob.percentage
agent.lastjobruntime.percentage
## Date 25th November
Thank you Tracey tboggiano
Added new CIS Check for OLE AUtomation Procedures to be disabled #707
##Latest
Run Get-DbcReleaseNotes for all release notes
"
@@ -1,3 +1,32 @@
## Date 16th November
Thank you Matt @matt2005
Removed rogue else from Agents Tests #713

##Latest

## Date 17th October
Thank you Shane @SOZDBA
Improved Documentation
Thank you Gareth NewMan
Added New Check - Default File Path

## Date 1st October 2019
Thank you Rob
Fixed some merge issues with a load of code :-(
Created GitHub Action to run Pester Checks on PR
Thank you @TracyBoggiano
Added New Checks
RemoteAccessDisabled
ScanForStartUpProcedures
Thank you Gareth Newman
Improved wording in tests #700 , #697
Fix incorrect calculation in last agent run time #696 #698
Fixed bug in AllInstanceInfo
Thank you Richard Imenes
Fixed dead links in readme #702
Thank you Benjamin Schenk
Fixed Send-MailMessage in readme #705

## Date 30th July 2019
Thank you Rob ;-)
Added two new checks #239
@@ -8,8 +37,6 @@ Added four new configs
agent.longrunningjob.percentage
agent.lastjobruntime.percentage

##Latest

## Date 29th July 2019
Thank you @TracyBoggiano
Added tags for checks that will be part of CIS checks #642
@@ -80,6 +80,8 @@ Invoke-DbcCheck [-Script <Object[]>] [-TestName <String[]>] [-EnableExit] [[-Che
[-ConfigPolicyRecoverymodelExcludedb <Object>] [-ConfigPolicyRecoverymodelType <Object>]
[-ConfigPolicySecurityAdhocdistributedqueriesenabled <Object>] [-ConfigPolicySecurityClrenabled <Object>]
[-ConfigPolicySecurityCrossdbownershipchaining <Object>] [-ConfigPolicySecurityDatabasemailenabled <Object>]
[-ConfigPolicySecurityRemoteaccessdisabled <Object>]
[-ConfigPolicySecurityScanforstartupproceduresdisabled <Object>]
[-ConfigPolicySecurityXpcmdshelldisabled <Object>] [-ConfigPolicyServerCpuprioritisation <Object>]
[-ConfigPolicyServerExcludeDiskAllocationUnit <Object>] [-ConfigPolicyStorageBackuppath <Object>]
[-ConfigPolicyTraceflagsExpected <Object>] [-ConfigPolicyTraceflagsNotexpected <Object>]
@@ -93,7 +95,8 @@ Invoke-DbcCheck [-Script <Object[]>] [-TestName <String[]>] [-EnableExit] [[-Che
[-ConfigSkipDatabaseLogfilecounttest <Object>] [-ConfigSkipDatafilegrowthdisabled <Object>]
[-ConfigSkipDbccDatapuritycheck <Object>] [-ConfigSkipDiffbackuptest <Object>]
[-ConfigSkipHadrListenerPingcheck <Object>] [-ConfigSkipInstanceDefaulttrace <Object>]
[-ConfigSkipInstanceModeldbgrowth <Object>] [-ConfigSkipLogfilecounttest <Object>]
[-ConfigSkipInstanceModeldbgrowth <Object>] [-ConfigSkipInstanceRemoteaccessdisabled <Object>]
[-ConfigSkipInstanceScanforstartupproceduresdisabled <Object>] [-ConfigSkipLogfilecounttest <Object>]
[-ConfigSkipLogshiptesting <Object>] [-ConfigSkipTempdb1118 <Object>] [-ConfigSkipTempdbfilecount <Object>]
[-ConfigSkipTempdbfilegrowthpercent <Object>] [-ConfigSkipTempdbfilesizemax <Object>]
[-ConfigSkipTempdbfilesonc <Object>] [-ConfigTestingIntegrationInstance <Object>] [<CommonParameters>]
@@ -174,6 +177,8 @@ Invoke-DbcCheck [-Script <Object[]>] [-TestName <String[]>] [-EnableExit] [[-Che
[-ConfigPolicyRecoverymodelExcludedb <Object>] [-ConfigPolicyRecoverymodelType <Object>]
[-ConfigPolicySecurityAdhocdistributedqueriesenabled <Object>] [-ConfigPolicySecurityClrenabled <Object>]
[-ConfigPolicySecurityCrossdbownershipchaining <Object>] [-ConfigPolicySecurityDatabasemailenabled <Object>]
[-ConfigPolicySecurityRemoteaccessdisabled <Object>]
[-ConfigPolicySecurityScanforstartupproceduresdisabled <Object>]
[-ConfigPolicySecurityXpcmdshelldisabled <Object>] [-ConfigPolicyServerCpuprioritisation <Object>]
[-ConfigPolicyServerExcludeDiskAllocationUnit <Object>] [-ConfigPolicyStorageBackuppath <Object>]
[-ConfigPolicyTraceflagsExpected <Object>] [-ConfigPolicyTraceflagsNotexpected <Object>]
@@ -187,7 +192,8 @@ Invoke-DbcCheck [-Script <Object[]>] [-TestName <String[]>] [-EnableExit] [[-Che
[-ConfigSkipDatabaseLogfilecounttest <Object>] [-ConfigSkipDatafilegrowthdisabled <Object>]
[-ConfigSkipDbccDatapuritycheck <Object>] [-ConfigSkipDiffbackuptest <Object>]
[-ConfigSkipHadrListenerPingcheck <Object>] [-ConfigSkipInstanceDefaulttrace <Object>]
[-ConfigSkipInstanceModeldbgrowth <Object>] [-ConfigSkipLogfilecounttest <Object>]
[-ConfigSkipInstanceModeldbgrowth <Object>] [-ConfigSkipInstanceRemoteaccessdisabled <Object>]
[-ConfigSkipInstanceScanforstartupproceduresdisabled <Object>] [-ConfigSkipLogfilecounttest <Object>]
[-ConfigSkipLogshiptesting <Object>] [-ConfigSkipTempdb1118 <Object>] [-ConfigSkipTempdbfilecount <Object>]
[-ConfigSkipTempdbfilegrowthpercent <Object>] [-ConfigSkipTempdbfilesizemax <Object>]
[-ConfigSkipTempdbfilesonc <Object>] [-ConfigTestingIntegrationInstance <Object>] [<CommonParameters>]
@@ -2741,6 +2747,36 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -ConfigPolicySecurityRemoteaccessdisabled
{{ Fill ConfigPolicySecurityRemoteaccessdisabled Description }}
```yaml
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -ConfigPolicySecurityScanforstartupproceduresdisabled
{{ Fill ConfigPolicySecurityScanforstartupproceduresdisabled Description }}
```yaml
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -ConfigPolicySecurityXpcmdshelldisabled
{{ Fill ConfigPolicySecurityXpcmdshelldisabled Description }}
@@ -3161,6 +3197,36 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -ConfigSkipInstanceRemoteaccessdisabled
{{ Fill ConfigSkipInstanceRemoteaccessdisabled Description }}
```yaml
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -ConfigSkipInstanceScanforstartupproceduresdisabled
{{ Fill ConfigSkipInstanceScanforstartupproceduresdisabled Description }}
```yaml
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -ConfigSkipLogfilecounttest
{{ Fill ConfigSkipLogfilecounttest Description }}
@@ -30,13 +30,6 @@ Start-DbcPowerBi -Path \\nas\projects\dbachecks.pbix
Launches \\\\nas\projects\dbachecks.pbix using "C:\windows\Temp\dbachecks\*.json" as the datasource
### EXAMPLE 3
```
Start-DbcPowerBi -Path \\nas\projects\dbachecks.pbix -DataSource "C:\windows\Temp\dbachecks.json"
```
Launches \\\\nas\projects\dbachecks.pbix using "C:\windows\Temp\dbachecks.json" as the datasource
## PARAMETERS
### -Path
@@ -26,11 +26,6 @@ Start-DbcPowerBi -Path \\nas\projects\dbachecks.pbix
Launches \\nas\projects\dbachecks.pbix using "C:\windows\Temp\dbachecks\*.json" as the datasource
.EXAMPLE
Start-DbcPowerBi -Path \\nas\projects\dbachecks.pbix -DataSource "C:\windows\Temp\dbachecks.json"
Launches \\nas\projects\dbachecks.pbix using "C:\windows\Temp\dbachecks.json" as the datasource
.LINK
https://dbachecks.readthedocs.io/en/latest/functions/Start-DbcPowerBi/

0 comments on commit 83e09c4

Please sign in to comment.
You can’t perform that action at this time.