Skip to content
Permalink
Browse files

1.0.74

  • Loading branch information
potatoqualitee committed Dec 2, 2019
1 parent 62d642f commit 0d3c3d126eef775fcba49ad2e71b8b5828d47154
Showing with 127 additions and 20 deletions.
  1. +46 −9 allcommands.ps1
  2. +69 −3 bin/dbatools-index.json
  3. +1 −1 dbatools.psd1
  4. +11 −7 en-us/dbatools-help.xml
@@ -26761,7 +26761,7 @@ function Get-DbaFeature {

begin {
$scriptblock = {
$setup = Get-ChildItem -Recurse -Include setup.exe -Path "$env:ProgramFiles\Microsoft SQL Server" -ErrorAction SilentlyContinue |
$setup = Get-ChildItem -Recurse -Include setup.exe -Path "$([System.Environment]::GetFolderPath("ProgramFiles"))\Microsoft SQL Server" -ErrorAction SilentlyContinue |
Where-Object { $_.FullName -match 'Setup Bootstrap\\SQL' -or $_.FullName -match 'Bootstrap\\Release\\Setup.exe' -or $_.FullName -match 'Bootstrap\\Setup.exe' } |
Sort-Object FullName -Descending | Select-Object -First 1
if ($setup) {
@@ -32782,7 +32782,7 @@ function Get-DbaRegServer {
}
process {
if (-not $PSBoundParameters.SqlInstance -and -not ($IsLinux -or $IsMacOs)) {
$null = Get-ChildItem -Recurse "$env:APPDATA\Microsoft\*sql*" -Filter RegSrvr.xml | Sort-Object LastWriteTime -Descending | Select-Object -First 1
$null = Get-ChildItem -Recurse "$(Get-DbatoolsPath -Name appdata)\Microsoft\*sql*" -Filter RegSrvr.xml | Sort-Object LastWriteTime -Descending | Select-Object -First 1
}

$servers = @()
@@ -35119,6 +35119,20 @@ function Get-DbatoolsLog {
}
}

#.ExternalHelp dbatools-Help.xml
function Get-DbatoolsPath {

[CmdletBinding()]
Param (
[Parameter(Mandatory = $true, Position = 0)]
[string]$Name
)

process {
Get-DbatoolsConfigValue -FullName "Path.Managed.$Name"
}
}

#.ExternalHelp dbatools-Help.xml
function Get-DbaTopResourceUsage {

@@ -40290,7 +40304,7 @@ function Invoke-DbaAdvancedInstall {
[version]$Version
)
$versionNumber = "$($Version.Major)$($Version.Minor)".Substring(0, 3)
$rootPath = "$env:ProgramFiles\Microsoft SQL Server\$versionNumber\Setup Bootstrap\Log"
$rootPath = "$([System.Environment]::GetFolderPath("ProgramFiles"))\Microsoft SQL Server\$versionNumber\Setup Bootstrap\Log"
$summaryPath = "$rootPath\Summary.txt"
$output = [PSCustomObject]@{
Path = $null
@@ -46414,7 +46428,7 @@ function Invoke-DbaQuery {

switch -regex ($uri.Scheme) {
"http" {
$tempfile = "$env:TEMP\$temporaryFilesPrefix-$temporaryFilesCount.sql"
$tempfile = "$(Get-DbatoolsPath -Name temp)\$temporaryFilesPrefix-$temporaryFilesCount.sql"
try {
try {
Invoke-TlsWebRequest -Uri $item -OutFile $tempfile -ErrorAction Stop
@@ -46479,7 +46493,7 @@ function Invoke-DbaQuery {
}

try {
$newfile = "$env:TEMP\$temporaryFilesPrefix-$temporaryFilesCount.sql"
$newfile = "$(Get-DbatoolsPath -Name temp)\$temporaryFilesPrefix-$temporaryFilesCount.sql"
Set-Content -Value $code -Path $newfile -Force -ErrorAction Stop -Encoding UTF8
$files += $newfile
$temporaryFilesCount++
@@ -64838,7 +64852,7 @@ function Set-DbaPowerPlan {
[string]$PowerPlan = 'High Performance',
[string]$CustomPowerPlan,
[parameter(ValueFromPipeline)]
[pscustomobject]$InputObject,
[pscustomobject[]]$InputObject,
[switch]$EnableException
)

@@ -65763,6 +65777,29 @@ function Set-DbaTempDbConfig {
}
}

#.ExternalHelp dbatools-Help.xml
function Set-DbatoolsPath {

[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")]
[CmdletBinding(DefaultParameterSetName = 'Default')]
param (
[Parameter(Mandatory = $true)]
[string]$Name,
[Parameter(Mandatory = $true)]
[string]$Path,
[Parameter(ParameterSetName = 'Register', Mandatory = $true)]
[switch]$Register,
[Parameter(ParameterSetName = 'Register')]
[Sqlcollaborative.Dbatools.Configuration.ConfigScope]
$Scope = [Sqlcollaborative.Dbatools.Configuration.ConfigScope]::UserDefault
)

process {
Set-DbatoolsConfig -FullName "Path.Managed.$Name" -Value $Path
if ($Register) { Register-DbatoolsConfig -FullName "Path.Managed.$Name" -Scope $Scope }
}
}

#.ExternalHelp dbatools-Help.xml
function Show-DbaDbList {

@@ -71722,7 +71759,7 @@ function Test-DbaPowerPlan {
[PSCredential]$Credential,
[string]$CustomPowerPlan,
[parameter(ValueFromPipeline)]
[pscustomobject]$InputObject,
[pscustomobject[]]$InputObject,
[switch]$EnableException
)

@@ -72726,7 +72763,7 @@ function Uninstall-DbatoolsWatchUpdate {
Write-Message -Level Warning -Message "Task doesn't exist. Skipping removal."
} else {
Write-Message -Level Output -Message "Removing watchupdate.xml."
$file = "$env:LOCALAPPDATA\dbatools\watchupdate.xml"
$file = "$(Get-DbatoolsPath -Name localappdata)\dbatools\watchupdate.xml"
Remove-Item $file -ErrorAction SilentlyContinue

Write-Message -Level Output -Message "Removing Scheduled Task 'dbatools version check'."
@@ -73493,7 +73530,7 @@ function Watch-DbatoolsUpdate {

if ($galleryVersion -le $localVersion) { return }

$file = "$env:LOCALAPPDATA\dbatools\watchupdate.xml"
$file = "$(Get-DbatoolsPath -Name localappdata)\dbatools\watchupdate.xml"

$new = [PSCustomObject]@{
NotifyVersion = $galleryVersion
@@ -17175,7 +17175,7 @@
},
{
"Name": "Get-DbaFeature",
"Description": "Runs the SQL Server feature discovery report (setup.exe /Action=RunDiscovery)\n\nInspired by Dave Mason\u0027s (@BeginTry) post at\nhttps://itsalljustelectrons.blogspot.be/2018/04/SQL-Server-Discovery-Report.html\n\nAssumptions:\n1. The sub-folder \"Microsoft SQL Server\" exists in $env:ProgramFiles,\neven if SQL was installed to a non-default path. This has been\nverified on SQL 2008R2 and SQL 2012. Further verification may be needed.\n2. The discovery report displays installed components for the version of SQL\nServer associated with setup.exe, along with installed components of all\nlesser versions of SQL Server that are installed.",
"Description": "Runs the SQL Server feature discovery report (setup.exe /Action=RunDiscovery)\n\nInspired by Dave Mason\u0027s (@BeginTry) post at\nhttps://itsalljustelectrons.blogspot.be/2018/04/SQL-Server-Discovery-Report.html\n\nAssumptions:\n1. The sub-folder \"Microsoft SQL Server\" exists in [System.Environment]::GetFolderPath(\"ProgramFiles\"),\neven if SQL was installed to a non-default path. This has been\nverified on SQL 2008R2 and SQL 2012. Further verification may be needed.\n2. The discovery report displays installed components for the version of SQL\nServer associated with setup.exe, along with installed components of all\nlesser versions of SQL Server that are installed.",
"Tags": [
"Feature",
"Component"
@@ -22051,6 +22051,27 @@
],
"Syntax": "Get-DbatoolsLog [[-FunctionName] \u003cString\u003e] [[-ModuleName] \u003cString\u003e] [[-Target] \u003cObject\u003e] [[-Tag] \u003cString[]\u003e] [[-Last] \u003cInt32\u003e] [-LastError] [[-Skip] \u003cInt32\u003e] [[-Runspace] \u003cGuid\u003e] [[-Level] {Critical | Important | Output | Significant | VeryVerbose | Verbose | SomewhatVerbose | System | Debug | InternalComment | Warning}] [-Raw] [-Errors] [\u003cCommonParameters\u003e]"
},
{
"Name": "Get-DbatoolsPath",
"Description": "Access a configured path.\nPaths can be configured using Set-DbatoolsPath or using the configuration system.\nTo register a path using the configuration system create a setting key named like this:\n\"Path.Managed.\u003cPathName\u003e\"\nFor example the following setting points at the temp path:\n\"Path.Managed.Temp\"",
"Synopsis": "Access a configured path.",
"Alias": "",
"CommandName": "Get-DbatoolsPath",
"Availability": "Windows, Linux, macOS",
"Links": null,
"Examples": "-------------------------- EXAMPLE 1 --------------------------\nPS C:\\\u003eGet-DbatoolsPath -Name \u0027temp\u0027\nReturns the temp path.",
"Params": [
[
"Name",
"Name of the path to retrieve.",
"",
true,
"false",
""
]
],
"Syntax": "Get-DbatoolsPath [-Name] \u003cString\u003e [\u003cCommonParameters\u003e]"
},
{
"Name": "Get-DbaTopResourceUsage",
"Description": "Returns the top 20 resource consumers for cached queries based on four different metrics: duration, frequency, IO, and CPU.\n\nThis command is based off of queries provided by Michael J. Swart at http://michaeljswart.com/go/Top20\n\nPer Michael: \"I\u0027ve posted queries like this before, and others have written many other versions of this query. All these queries are based on sys.dm_exec_query_stats.\"",
@@ -43890,7 +43911,7 @@
""
]
],
"Syntax": "Set-DbaPowerPlan [[-ComputerName] \u003cDbaInstanceParameter[]\u003e] [[-Credential] \u003cPSCredential\u003e] [[-PowerPlan] \u003cString\u003e] [[-CustomPowerPlan] \u003cString\u003e] [[-InputObject] \u003cPSObject\u003e] [-EnableException] [-WhatIf] [-Confirm] [\u003cCommonParameters\u003e]"
"Syntax": "Set-DbaPowerPlan [[-ComputerName] \u003cDbaInstanceParameter[]\u003e] [[-Credential] \u003cPSCredential\u003e] [[-PowerPlan] \u003cString\u003e] [[-CustomPowerPlan] \u003cString\u003e] [[-InputObject] \u003cPSObject[]\u003e] [-EnableException] [-WhatIf] [-Confirm] [\u003cCommonParameters\u003e]"
},
{
"Name": "Set-DbaPrivilege",
@@ -44522,6 +44543,51 @@
],
"Syntax": "Set-DbaTempDbConfig [-SqlInstance] \u003cDbaInstanceParameter[]\u003e [[-SqlCredential] \u003cPSCredential\u003e] [[-DataFileCount] \u003cInt32\u003e] [-DataFileSize] \u003cInt32\u003e [[-LogFileSize] \u003cInt32\u003e] [[-DataFileGrowth] \u003cInt32\u003e] [[-LogFileGrowth] \u003cInt32\u003e] [[-DataPath] \u003cString\u003e] [[-LogPath] \u003cString\u003e] [[-OutFile] \u003cString\u003e] [-OutputScriptOnly] [-DisableGrowth] [-EnableException] [-WhatIf] [-Confirm] [\u003cCommonParameters\u003e]"
},
{
"Name": "Set-DbatoolsPath",
"Description": "Configures or updates a path under a name.\nThe path can be persisted using the \"-Register\" command.\nPaths setup like this can be retrieved using Get-DbatoolsPath.",
"Synopsis": "Configures or updates a path under a name.",
"Alias": "",
"CommandName": "Set-DbatoolsPath",
"Availability": "Windows, Linux, macOS",
"Links": null,
"Examples": "-------------------------- EXAMPLE 1 --------------------------\nPS C:\\\u003eSet-DbatoolsPath -Name \u0027temp\u0027 -Path \u0027C:\\temp\u0027\nConfigures C:\\temp as the current temp path. (does not override $env:temp !)",
"Params": [
[
"Name",
"Name the path should be stored under.",
"",
true,
"false",
""
],
[
"Path",
"The path that should be returned under the name.",
"",
true,
"false",
""
],
[
"Register",
"Registering a path in order for it to persist across sessions.",
"",
true,
"false",
"False"
],
[
"Scope",
"The configuration scope it should be registered under.\r\nDefaults to UserDefault.\r\nConfiguration scopes are the default locations configurations are being stored at.",
"",
false,
"false",
"UserDefault"
]
],
"Syntax": "Set-DbatoolsPath -Name \u003cString\u003e -Path \u003cString\u003e [\u003cCommonParameters\u003e]\nSet-DbatoolsPath -Name \u003cString\u003e -Path \u003cString\u003e -Register [-Scope {UserDefault | UserMandatory | SystemDefault | SystemMandatory | FileUserLocal | FileUserShared | FileSystem}] [\u003cCommonParameters\u003e]"
},
{
"Name": "Show-DbaDbList",
"Description": "Shows a list of databases in a GUI. Returns a string holding the name of the selected database. Hitting cancel returns null.",
@@ -48509,7 +48575,7 @@
"False"
]
],
"Syntax": "Test-DbaPowerPlan [[-ComputerName] \u003cDbaInstanceParameter[]\u003e] [[-Credential] \u003cPSCredential\u003e] [[-CustomPowerPlan] \u003cString\u003e] [[-InputObject] \u003cPSObject\u003e] [-EnableException] [\u003cCommonParameters\u003e]"
"Syntax": "Test-DbaPowerPlan [[-ComputerName] \u003cDbaInstanceParameter[]\u003e] [[-Credential] \u003cPSCredential\u003e] [[-CustomPowerPlan] \u003cString\u003e] [[-InputObject] \u003cPSObject[]\u003e] [-EnableException] [\u003cCommonParameters\u003e]"
},
{
"Name": "Test-DbaRepLatency",
@@ -11,7 +11,7 @@
RootModule = 'dbatools.psm1'

# Version number of this module.
ModuleVersion = '1.0.73'
ModuleVersion = '1.0.74'

# ID used to uniquely identify this module
GUID = '9d139310-ce45-41ce-8e8b-d76335aa1789'

0 comments on commit 0d3c3d1

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