Skip to content

Commit

Permalink
because it is useful for developing
Browse files Browse the repository at this point in the history
  • Loading branch information
SQLDBAWithABeard committed Jan 1, 2023
1 parent 459efd5 commit 951d0bb
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
9 changes: 7 additions & 2 deletions containers/base/profile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', 'currentAccountName', Justification = 'Because silly script analyuser cant see it is used')]
[CmdletBinding()]
param()
# }
#endregion

if (Test-Path /workspace/containers -ErrorAction SilentlyContinue) {
Import-Module /workspace/containers/JessAndBeard.psm1
} else {
Import-Module /workspaces/dbachecks/containers/JessAndBeard.psm1
}


Remove-Item '/var/opt/backups/dbachecks1' -Recurse -Force -ErrorAction SilentlyContinue
Remove-Item '/shared' -Recurse -Force -ErrorAction SilentlyContinue
Expand Down
22 changes: 22 additions & 0 deletions source/internal/functions/Get-v5Checks.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
function Get-v5Checks {
$v5files = Get-ChildItem -Path $v5Path -Recurse -Filter *.ps1 -Exclude *-v5.ps1
[Management.Automation.Language.Parser]::ParseInput($GroupContent, [ref]$tokens, [ref]$errors).
FindAll([Func[Management.Automation.Language.Ast, bool]] {
param ($ast)
$ast.CommandElements -and
$ast.CommandElements[0].Value -eq 'describe'
}, $true) |
ForEach-Object {
$CE = $PSItem.CommandElements
$secondString = ($CE | Where-Object { $PSItem.StaticType.name -eq 'string' })[1]
$tagIdx = $CE.IndexOf(($CE | Where-Object ParameterName -EQ 'Tags')) + 1
$tags = if ($tagIdx -and $tagIdx -lt $CE.Count) {
$CE[$tagIdx].Extent
}
New-Object PSCustomObject -Property @{
GroupName = $GroupName
CheckTitle = $secondString
CheckTags = $tags
}
}
}

0 comments on commit 951d0bb

Please sign in to comment.