This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# activating extensions | |
extensions = ["sphinxcontrib.napoleon", "sphinxcontrib.confluencebuilder"] | |
# supported source file types | |
source_suffix = [".rst"] | |
# Confluence general configuration | |
confluence_publish = True | |
confluence_server_url = "https://<server name here>.atlassian.net/wiki/" | |
# Confluence credentials are retrieved from environment variables in this example |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
project = "mymodulename" | |
copyright = "<license>" | |
author = "<Your name here>" | |
release = "<version string if you need it>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
sys.path.insert(0, os.path.abspath("..")) | |
import mymodulename |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyClass(object): | |
"""Short description here. | |
Args: | |
input (str): first argument here | |
num (int): some other arg | |
Attributes: | |
attribute (str): Attribute description | |
num (int): some other attribute |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class testclass { | |
[string]$foo | |
testclass($input) { | |
$this.foo = $input | |
} | |
} | |
enum testenum { | |
foo | |
bar | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param ( | |
$SourceServer, | |
$TargetServer, | |
$Login | |
) | |
$loginObject = Get-DbaLogin -SqlInstance $SourceServer -Login $Login | |
Copy-DbaLogin -Destination $TargetServer -Login $loginObject | |
foreach ($dbName in $login.EnumDatabaseMappings()) { | |
$db = Get-DbaDatabase -SqlInstance $SourceServer -Database $dbName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param ( | |
$SourceServer, | |
$TargetServer, | |
$SourceDatabase, | |
$TargetDatabase | |
) | |
$permissions = Export-DbaUser -SqlInstance $SourceServer -Database $SourceDatabase | |
Invoke-DbaQuery -SqlInstance $TargetServer -Database $TargetDatabase -Query $permissions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Prompt { | |
try { | |
$history = Get-History -ErrorAction Ignore -Count 1 | |
if ($history) { | |
$ts = New-TimeSpan $history.StartExecutionTime $history.EndExecutionTime | |
switch ($ts) { | |
{$_.TotalMinutes -ge 1 } { | |
'[{0,5:f1} m]' -f $_.TotalMinutes | Write-Host -ForegroundColor Red -NoNewline | |
} | |
{$_.TotalMinutes -lt 1 -and $_.TotalSeconds -ge 1} { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install a DBOps package to the MySQL server | |
Install-DBOPackage -Type MySQL -Server localhost -Database mydb -Path .\package.zip | |
# invoke a query against a remote PostgreSQL server | |
Invoke-DBOQuery -Type PostgreSQL -SqlInstance pgsql1:5432 -Database mydb -Query 'SELECT current_database();' | |
# change the default connection -Type (SQLServer) to PostgreSQL: | |
Set-DBODefaultSetting -Name rdbms.type -Value 'PostgreSQL' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get current database from a PostgreSQL server | |
Invoke-DBOQuery -Type PostgreSQL -Server localhost:5432 -Database postgres -Query 'SELECT current_database()' -As SingleValue | |
# Run a query against MySQL database | |
Invoke-DBOQuery -Type MySQL -Server localhost -Database mysql -Query 'SELECT Name from Users' | |
# Run multiple files from a folder in a specific SQL Server database | |
Get-ChildItem .\Scripts | Invoke-DBOQuery -SqlInstance 'SqlServer1:1443' -Database MyDB | |
# Connect to an Oracle database interactively as SYSDBA |
NewerOlder