2020-09-11 14:59:17 +03:00
|
|
|
function Get-PostgreSqlVersion {
|
2020-09-14 10:09:05 +03:00
|
|
|
$postgreSQLVersion = psql --version | Take-OutputPart -Part 2
|
2022-12-21 19:38:54 +01:00
|
|
|
return $postgreSQLVersion
|
2020-09-11 14:59:17 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function Get-MongoDbVersion {
|
2020-09-14 10:09:05 +03:00
|
|
|
$mongoDBVersion = mongod --version | Select-Object -First 1 | Take-OutputPart -Part 2 -Delimiter "v"
|
2022-12-21 19:38:54 +01:00
|
|
|
return $mongoDBVersion
|
2020-09-11 14:59:17 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function Get-SqliteVersion {
|
2020-09-14 10:09:05 +03:00
|
|
|
$sqliteVersion = sqlite3 --version | Take-OutputPart -Part 0
|
2022-12-21 19:38:54 +01:00
|
|
|
return $sqliteVersion
|
2020-09-11 14:59:17 +03:00
|
|
|
}
|
|
|
|
|
|
2020-09-14 11:31:41 +03:00
|
|
|
function Get-MySQLVersion {
|
2021-12-07 23:38:14 +03:00
|
|
|
$mySQLVersion = mysqld --version | Take-OutputPart -Part 2
|
2022-12-21 19:38:54 +01:00
|
|
|
return $mySQLVersion
|
2020-09-14 10:09:05 +03:00
|
|
|
}
|
|
|
|
|
|
2020-11-17 10:18:27 +03:00
|
|
|
function Get-SQLCmdVersion {
|
|
|
|
|
$sqlcmdVersion = sqlcmd -? | Select-String -Pattern "Version" | Take-OutputPart -Part 1
|
2022-12-21 19:38:54 +01:00
|
|
|
return $sqlcmdVersion
|
2020-11-17 10:18:27 +03:00
|
|
|
}
|
|
|
|
|
|
2021-07-12 00:59:56 -07:00
|
|
|
function Get-SqlPackageVersion {
|
|
|
|
|
$sqlPackageVersion = sqlpackage /version
|
2022-12-21 19:38:54 +01:00
|
|
|
return $sqlPackageVersion
|
2021-07-12 00:59:56 -07:00
|
|
|
}
|
|
|
|
|
|
2022-02-16 08:55:13 +01:00
|
|
|
function Build-PostgreSqlSection {
|
2022-12-21 19:38:54 +01:00
|
|
|
$node = [HeaderNode]::new("PostgreSQL")
|
|
|
|
|
$node.AddToolVersion("PostgreSQL", $(Get-PostgreSqlVersion))
|
|
|
|
|
$node.AddNote(@(
|
2022-12-13 17:07:05 +01:00
|
|
|
"User: postgres",
|
|
|
|
|
"PostgreSQL service is disabled by default.",
|
|
|
|
|
"Use the following command as a part of your job to start the service: 'sudo systemctl start postgresql.service'"
|
2022-12-21 19:38:54 +01:00
|
|
|
) -join "`n")
|
2022-02-16 08:55:13 +01:00
|
|
|
|
2022-12-21 19:38:54 +01:00
|
|
|
return $node
|
2022-02-16 08:55:13 +01:00
|
|
|
}
|
|
|
|
|
|
2020-09-14 10:09:05 +03:00
|
|
|
function Build-MySQLSection {
|
2022-12-21 19:38:54 +01:00
|
|
|
$node = [HeaderNode]::new("MySQL")
|
|
|
|
|
$node.AddToolVersion("MySQL", $(Get-MySQLVersion))
|
|
|
|
|
$node.AddNote(@(
|
2022-12-13 17:07:05 +01:00
|
|
|
"User: root",
|
|
|
|
|
"Password: root",
|
|
|
|
|
"MySQL service is disabled by default.",
|
|
|
|
|
"Use the following command as a part of your job to start the service: 'sudo systemctl start mysql.service'"
|
2022-12-21 19:38:54 +01:00
|
|
|
) -join "`n")
|
2020-09-14 10:09:05 +03:00
|
|
|
|
2022-12-21 19:38:54 +01:00
|
|
|
return $node
|
2020-11-17 10:18:27 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function Build-MSSQLToolsSection {
|
2022-12-21 19:38:54 +01:00
|
|
|
$node = [HeaderNode]::new("MS SQL")
|
|
|
|
|
$node.AddToolVersion("sqlcmd", $(Get-SQLCmdVersion))
|
|
|
|
|
$node.AddToolVersion("SqlPackage", $(Get-SqlPackageVersion))
|
|
|
|
|
return $node
|
2021-08-19 12:54:18 +02:00
|
|
|
}
|