Public/Get-PdqDatabaseTables.ps1
<#
.SYNOPSIS Retrieves all table names from the specified product's database. .INPUTS None. .OUTPUTS System.Object[] .EXAMPLE Get-PdqDatabaseTables -Product 'Deploy' #> function Get-PdqDatabaseTables { [CmdletBinding()] param ( [ValidateSet('Deploy', 'Inventory')] # The PDQ application you would like to execute this function against. [String]$Product, # The path to the currently active database will be retrieved by default. # You can use this parameter if you wish to run this function against a different database. [String]$DatabasePath ) $TablesQuery = "SELECT name FROM sqlite_master WHERE type IN ('table', 'view') ORDER BY name COLLATE NOCASE;" (Invoke-PdqSqlQuery -Product $Product -DatabasePath $DatabasePath -Query $TablesQuery).name } |