Permalink
Browse files

formatting update

  • Loading branch information...
potatoqualitee committed Nov 14, 2018
1 parent 6f0e173 commit 0fbd26f6aaa9107a2aa45838b4a7d3252dbd8f4d
Showing 1,196 changed files with 3,511 additions and 4,945 deletions.
@@ -4,26 +4,23 @@ param(
[ValidateSet('ps3', 'ps4', 'Release', 'Debug')]
[string] $MsbuildConfiguration = "Release",
[string] $MsbuildOptions = "",
[Parameter(HelpMessage='Target to run instead of build')]
[Parameter(HelpMessage = 'Target to run instead of build')]
[string] $MsbuildTarget = 'Build'
)
if (-not $PSBoundParameters.ContainsKey('MsbuildConfiguration'))
{
$_MsbuildConfiguration = switch ($PSVersionTable.PSVersion.Major)
{
if (-not $PSBoundParameters.ContainsKey('MsbuildConfiguration')) {
$_MsbuildConfiguration = switch ($PSVersionTable.PSVersion.Major) {
3 { "ps3" }
4 { "ps4" }
default { "Release" }
}
}
else { $_MsbuildConfiguration = $MsbuildConfiguration }
} else { $_MsbuildConfiguration = $MsbuildConfiguration }
function Get-MsBuildPath {
[CmdletBinding()]
[OutputType([string])]
param()
process{
process {
$rawPath = "$(Split-Path ([string].Assembly.Location))\msbuild.exe"
(Resolve-Path $rawPath).Path
}
@@ -60,10 +57,9 @@ if ($MsbuildTarget -eq 'Build') {
if ($script:alwaysBuildLibrary) { Move-Item -Path "$PSModuleRoot\bin\dbatools.dll" -Destination $script:DllRoot -Force -ErrorAction Stop }
else { Copy-Item -Path "$PSModuleRoot\bin\dbatools.dll" -Destination $script:DllRoot -Force -ErrorAction Stop }
Add-Type -Path "$PSModuleRoot\dbatools.dll" -ErrorAction Stop
}
catch {
} catch {
Write-Verbose -Message "Failed to copy & import, attempting to import straight from the module directory"
Add-Type -Path "$PSModuleRoot\bin\dbatools.dll" -ErrorAction Stop
}
Write-Verbose -Message "Total duration: $((Get-Date) - $start)"
}
}
@@ -39,17 +39,14 @@ $previousVersion = Import-Clixml ".\vsts-version.xml"
$currentVersion = [System.Diagnostics.FileVersionInfo]::GetVersionInfo((Get-Item "bin\dbatools.dll").FullName).FileVersion
Remove-Item ".\vsts-version.xml"
if ($previousVersion -ne $currentVersion)
{
if ($previousVersion -ne $currentVersion) {
$branch = $env:BUILD_SOURCEBRANCHNAME
Write-Host "Previous: $previousVersion | Current: $currentVersion | Library should be updated"
git add .
git commit -m "VSTS Library Compile ***NO_CI***"
$errorMessage = git push "https://$env:SYSTEM_ACCESSTOKEN@github.com/sqlcollaborative/dbatools.git" head:$branch 2>&1
if ($LASTEXITCODE -gt 0) { throw $errorMessage }
}
else
{
} else {
Write-Host "Version: $currentVersion | Library is up to date"
}
}
@@ -1,3 +1,3 @@
$item = Get-Item "bin\dbatools.dll"
$version = [System.Diagnostics.FileVersionInfo]::GetVersionInfo($item.FullName).FileVersion
$version | Export-Clixml ".\vsts-version.xml"
$version | Export-Clixml ".\vsts-version.xml"
@@ -39,8 +39,7 @@ if (([System.Management.Automation.PSTypeName]'Sqlcollaborative.Dbatools.Configu
# No need to load the library again, if the module was once already imported.
Write-Verbose -Message "Library already loaded, will not load again"
$ImportLibrary = $false
}
else {
} else {
Write-Verbose -Message "Library not present already, will import"
$ImportLibrary = $true
}
@@ -54,8 +53,7 @@ if ($ImportLibrary) {
if ($script:strictSecurityMode) {
if (Test-Path -Path "$libraryBase\dbatools.dll") {
Add-Type -Path "$libraryBase\dbatools.dll" -ErrorAction Stop
}
else {
} else {
throw "Library not found, terminating!"
}
}
@@ -70,17 +68,14 @@ if ($ImportLibrary) {
Write-Verbose -Message "Found library, trying to copy & import"
if ($libraryBase -ne $script:DllRoot) { Copy-Item -Path "$libraryBase\dbatools.dll" -Destination $script:DllRoot -Force -ErrorAction Stop }
Add-Type -Path "$script:DllRoot\dbatools.dll" -ErrorAction Stop
}
catch {
} catch {
Write-Verbose -Message "Failed to copy&import, attempting to import straight from the module directory"
Add-Type -Path "$libraryBase\dbatools.dll" -ErrorAction Stop
}
Write-Verbose -Message "Total duration: $((Get-Date) - $start)"
}
elseif ($hasProject) {
} elseif ($hasProject) {
. Import-ModuleFile "$($script:PSModuleRoot)\bin\build-project.ps1"
}
else {
} else {
throw "No valid dbatools library found! Check your module integrity"
}
}
@@ -89,8 +84,7 @@ if ($ImportLibrary) {
Update-TypeData -TypeName "Sqlcollaborative.Dbatools.dbaSystem.DbatoolsException" -SerializationDepth 2 -ErrorAction Ignore
Update-TypeData -TypeName "Sqlcollaborative.Dbatools.dbaSystem.DbatoolsExceptionRecord" -SerializationDepth 2 -ErrorAction Ignore
#endregion PowerShell TypeData
}
catch {
} catch {
#region Warning
Write-Warning @'
Dear User,
@@ -138,5 +132,4 @@ Please restart the console to apply the library update, or unexpected behavior w
If the issues continue to persist, please Remove-Item '$script:PSModuleRoot\bin\dbatools.dll'
"@
}
#endregion Version Warning
#endregion Version Warning
@@ -42,4 +42,4 @@ if (-not ([Sqlcollaborative.Dbatools.dbaSystem.SystemHost]::ModuleImported)) {
$this.ExecuteNonQuery($Command)
} -ErrorAction Ignore
}
}
@@ -29,8 +29,6 @@ $TypeAliasTable = @{
foreach ($TypeAlias in $TypeAliasTable.Keys) {
try {
$TAType::Add($TypeAlias, $TypeAliasTable[$TypeAlias])
} catch {
}
catch {
}
}
}
@@ -62,7 +62,7 @@ function Add-DbaAgDatabase {
PS C:\> Get-DbaDbSharePoint -SqlInstance sqlcluster -ConfigDatabase SharePoint_Config_2019 | Add-DbaAgDatabase -AvailabilityGroup SharePoint
Adds SharePoint databases as found in SharePoint_Config_2019 on sqlcluster to ag1 on sqlcluster
#>
#>
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'Low')]
param (
[DbaInstanceParameter[]]$SqlInstance,
@@ -103,5 +103,4 @@ function Add-DbaAgDatabase {
}
}
}
}
}
@@ -65,7 +65,7 @@ function Add-DbaAgListener {
Creates a listener on port 1433 with a dynamic IP for the group1 availability group on sql2017.
#>
#>
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'Low')]
param (
[DbaInstanceParameter[]]$SqlInstance,
@@ -92,7 +92,7 @@ function Add-DbaAgReplica {
PS C:\> Get-DbaAvailabilityGroup -SqlInstance sql2017a -AvailabilityGroup SharePoint | Add-DbaAgReplica -SqlInstance sql2017b -FailoverMode Manual
Adds sql2017b to the SharePoint availability group on sql2017a with a manual failover mode.
#>
#>
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'Low')]
param (
[DbaInstanceParameter[]]$SqlInstance,
@@ -203,4 +203,4 @@ function Add-DbaAgReplica {
}
}
}
}
}
@@ -74,7 +74,7 @@ function Add-DbaCmsRegServer {
Creates a registered server on sql2008's CMS which points to the SQL Server, sql01. When scrolling in CMS, the name "sql01" will be visible within the Seattle group which is in the hr group.
#>
#>
[CmdletBinding(SupportsShouldProcess)]
param (
[Alias("ServerInstance", "SqlServer")]
@@ -142,5 +142,4 @@ function Add-DbaCmsRegServer {
end {
Test-DbaDeprecation -DeprecatedOn "1.0.0" -Alias Add-DbaRegisteredServer
}
}
}
@@ -64,7 +64,7 @@ function Add-DbaCmsRegServerGroup {
Creates a registered server group on sql2012 and sql2014 called sub-folder within the HR group of each server
#>
#>
[CmdletBinding(SupportsShouldProcess)]
param (
[Alias("ServerInstance", "SqlServer")]
@@ -116,5 +116,4 @@ function Add-DbaCmsRegServerGroup {
end {
Test-DbaDeprecation -DeprecatedOn "1.0.0" -Alias Add-DbaRegisteredServerGroup
}
}
}
@@ -57,7 +57,7 @@ function Add-DbaComputerCertificate {
Adds the local C:\temp\cert.cer to the local computer's LocalMachine\My (Personal) certificate store.
#>
#>
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = "High")]
param (
[Alias("ServerInstance", "SqlServer", "SqlInstance")]
@@ -147,5 +147,4 @@ function Add-DbaComputerCertificate {
}
}
}
}
}
@@ -42,7 +42,7 @@ function Add-DbaDbMirrorMonitor {
Creates a database mirroring monitor job that periodically updates the mirroring status for every mirrored database on sql2008 and sql2012.
#>
#>
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'Low')]
param (
[parameter(Mandatory, ValueFromPipeline)]
@@ -73,5 +73,4 @@ function Add-DbaDbMirrorMonitor {
}
}
}
}
}
@@ -59,7 +59,7 @@ function Add-DbaPfDataCollectorCounter {
Allows you to select which Data Collector you'd like to add the counter '\LogicalDisk(*)\Avg. Disk Queue Length' on localhost and prompts for confirmation.
#>
#>
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = "Low")]
param (
[DbaInstance[]]$ComputerName = $env:COMPUTERNAME,
@@ -138,5 +138,4 @@ function Add-DbaPfDataCollectorCounter {
}
}
}
}
}
@@ -168,7 +168,7 @@ function Backup-DbaDatabase {
PS C:\> Backup-DbaDatabase -SqlInstance Sql2017 -Database master -BackupFileName NUL
Performs a backup of master, but sends the output to the NUL device (ie; throws it away)
#>
#>
[CmdletBinding(DefaultParameterSetName = "Default", SupportsShouldProcess)]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingPlainTextForPassword", "")] #For AzureCredential
param (
@@ -109,7 +109,7 @@ function Backup-DbaDbCertificate {
Exports all certificates found on sql2016 to the default data directory.
#>
#>
[CmdletBinding(DefaultParameterSetName = "Default", SupportsShouldProcess, ConfirmImpact = 'Low')]
param (
[parameter(Mandatory, ParameterSetName = "instance")]
@@ -248,5 +248,4 @@ function Backup-DbaDbCertificate {
}
}
}
}
}
@@ -68,7 +68,7 @@ function Backup-DbaDbMasterKey {
Logs into sql2016 with Windows credentials then backs up db1's keys to the \\nas\sqlbackups\keys directory.
#>
#>
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'Low')]
param (
[DbaInstanceParameter[]]$SqlInstance,
@@ -158,5 +158,4 @@ function Backup-DbaDbMasterKey {
end {
Test-DbaDeprecation -DeprecatedOn "1.0.0" -EnableException:$false -Alias Backup-DbaDatabaseMasterKey
}
}
}
@@ -42,7 +42,7 @@ function Clear-DbaConnectionPool {
Clears all connection pools on workstation27.
#>
#>
[CmdletBinding()]
param (
[Parameter(ValueFromPipeline)]
@@ -81,4 +81,4 @@ function Clear-DbaConnectionPool {
end {
Test-DbaDeprecation -DeprecatedOn "1.0.0" -EnableException:$false -Alias Clear-DbaSqlConnectionPool
}
}
}
@@ -54,7 +54,7 @@ function Clear-DbaLatchStatistics {
PS C:\> Clear-DbaLatchStatistics -SqlInstance sql2008 -SqlCredential $cred
Connects using sqladmin credential and clears latch statistics on servers sql2008 and sqlserver2012
#>
#>
[CmdletBinding(ConfirmImpact = 'High', SupportsShouldProcess)]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "", Justification = "Singular Noun doesn't make sense")]
param (
@@ -92,4 +92,4 @@ function Clear-DbaLatchStatistics {
}
}
}
}
}
@@ -59,7 +59,7 @@ function Clear-DbaPlanCache {
PS C:\> Find-DbaInstance -ComputerName localhost | Get-DbaPlanCache | Clear-DbaPlanCache -Threshold 200
Scans localhost for instances using the browser service, traverses all instances and gets the plan cache for each, clears them out if they are above 200 MB.
#>
#>
[CmdletBinding(SupportsShouldProcess)]
param (
[Alias("ServerInstance", "SqlServer", "SqlServers")]
@@ -107,5 +107,4 @@ function Clear-DbaPlanCache {
}
}
}
}
}
@@ -44,7 +44,7 @@ function Clear-DbaWaitStatistics {
Clears wait stats on servers sql2008 and sqlserver2012, without prompting
#>
#>
[CmdletBinding(ConfirmImpact = 'High', SupportsShouldProcess)]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "", Justification = "Singular Noun doesn't make sense")]
param (
@@ -81,4 +81,4 @@ function Clear-DbaWaitStatistics {
}
}
}
}
}
Oops, something went wrong.

0 comments on commit 0fbd26f

Please sign in to comment.