Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed ImportDbaCsv for non default SqlBulkCopyOptions #5004

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
6d537f0
Merge pull request #4757 from sqlcollaborative/development
potatoqualitee Dec 4, 2018
6bb33f9
Merge pull request #4759 from sqlcollaborative/development
potatoqualitee Dec 4, 2018
564fb56
Merge pull request #4773 from sqlcollaborative/development
potatoqualitee Dec 5, 2018
0c5b2cf
Merge pull request #4784 from sqlcollaborative/development
potatoqualitee Dec 7, 2018
7523403
Merge pull request #4790 from sqlcollaborative/development
potatoqualitee Dec 9, 2018
916c1e3
Merge pull request #4798 from sqlcollaborative/development
potatoqualitee Dec 10, 2018
3ea8f44
Merge pull request #4808 from sqlcollaborative/development
potatoqualitee Dec 12, 2018
41768bd
Merge pull request #4818 from sqlcollaborative/development
potatoqualitee Dec 14, 2018
7a85041
Merge pull request #4826 from sqlcollaborative/development
potatoqualitee Dec 15, 2018
5b4b739
Merge pull request #4831 from sqlcollaborative/development
potatoqualitee Dec 16, 2018
eaa6233
Merge pull request #4837 from sqlcollaborative/development
potatoqualitee Dec 18, 2018
3d71e7e
Removed function aliases.
cporteou Dec 19, 2018
b78e9ed
Merge pull request #4844 from cporteou/master
potatoqualitee Dec 19, 2018
b68334a
Merge pull request #4850 from sqlcollaborative/development
potatoqualitee Dec 19, 2018
7600db1
Merge pull request #4853 from sqlcollaborative/development
potatoqualitee Dec 20, 2018
6ca81a2
Merge pull request #4854 from sqlcollaborative/development
potatoqualitee Dec 20, 2018
f8082fe
Merge pull request #4860 from sqlcollaborative/development
potatoqualitee Dec 21, 2018
dd371f0
Merge pull request #4862 from sqlcollaborative/development
potatoqualitee Dec 21, 2018
7303110
Merge pull request #4863 from sqlcollaborative/development
potatoqualitee Dec 21, 2018
5c50abe
Merge pull request #4874 from sqlcollaborative/development
potatoqualitee Dec 23, 2018
77f1c0a
Merge pull request #4882 from sqlcollaborative/development
potatoqualitee Dec 26, 2018
2a2f38e
Merge pull request #4886 from sqlcollaborative/development
potatoqualitee Dec 31, 2018
5b02da6
Merge pull request #4892 from sqlcollaborative/development
potatoqualitee Jan 2, 2019
e55ff83
Merge pull request #4913 from sqlcollaborative/development
potatoqualitee Jan 7, 2019
2e4b938
Merge branch 'development'
potatoqualitee Jan 7, 2019
6e5f597
Merge pull request #4919 from sqlcollaborative/development
potatoqualitee Jan 8, 2019
c34d52d
Merge pull request #4931 from sqlcollaborative/development
potatoqualitee Jan 10, 2019
f2de838
Merge pull request #4939 from sqlcollaborative/development
potatoqualitee Jan 11, 2019
7ce387a
Merge pull request #4944 from sqlcollaborative/development
potatoqualitee Jan 11, 2019
5777b99
Merge pull request #4948 from sqlcollaborative/development
potatoqualitee Jan 11, 2019
697e37d
Merge pull request #4953 from sqlcollaborative/development
potatoqualitee Jan 15, 2019
59e4739
Merge pull request #4980 from sqlcollaborative/development
potatoqualitee Jan 20, 2019
3b8f364
Merge pull request #4991 from sqlcollaborative/development
potatoqualitee Jan 23, 2019
eeef2cf
Merge pull request #4996 from sqlcollaborative/development
potatoqualitee Jan 23, 2019
ee4c9a8
Merge pull request #5002 from sqlcollaborative/development
potatoqualitee Jan 23, 2019
8d93c1c
Fixed Import-DbaCsv when using SqlBulkCopyOptions
spaghettidba Jan 23, 2019
9d2e500
Merge branch 'development' into ImportDbaCsv
potatoqualitee Jan 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 30 additions & 30 deletions bin/dbatools-index.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bin/smo/smo-deps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ dir | %{
try { Add-Type -Path $_.FullName -ErrorAction Stop }
catch { $_.Exception.LoaderExceptions.FileName | %{ $dep += $_ }}
}
$dep | select -unique
$dep | Select-Object -unique
2 changes: 1 addition & 1 deletion en-us/about_dbatools_support.help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ LONG DESCRIPTION
most valuable piece of information for troubleshooting. Generally, you can
see that exception content by running the following line:

$error[0] | Select *
$error[0] | Select-Object *

Directly after the command failed. Screenshot it.

Expand Down
4 changes: 2 additions & 2 deletions functions/ConvertTo-DbaXESession.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function ConvertTo-DbaXESession {
License: MIT https://opensource.org/licenses/MIT

.EXAMPLE
PS C:\> Get-DbaTrace -SqlInstance sql2017, sql2012 | Where Id -eq 2 | ConvertTo-DbaXESession -Name 'Test'
PS C:\> Get-DbaTrace -SqlInstance sql2017, sql2012 | Where-Object Id -eq 2 | ConvertTo-DbaXESession -Name 'Test'

Converts Trace with ID 2 to a Session named Test on SQL Server instances named sql2017 and sql2012 and creates the Session on each respective server.

Expand All @@ -43,7 +43,7 @@ function ConvertTo-DbaXESession {
Converts selected traces on sql2014 to sessions, creates the session, and starts it.

.EXAMPLE
PS C:\> Get-DbaTrace -SqlInstance sql2014 | Where Id -eq 1 | ConvertTo-DbaXESession -Name 'Test' -OutputScriptOnly
PS C:\> Get-DbaTrace -SqlInstance sql2014 | Where-Object Id -eq 1 | ConvertTo-DbaXESession -Name 'Test' -OutputScriptOnly

Converts trace ID 1 on sql2014 to an Extended Event and outputs the resulting T-SQL.

Expand Down
2 changes: 1 addition & 1 deletion functions/Get-DbaAvailabilityGroup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function Get-DbaAvailabilityGroup {
Shows basic information on the Availability Group AG-a on sqlserver2014a.

.EXAMPLE
PS C:\> Get-DbaAvailabilityGroup -SqlInstance sqlserver2014a | Select *
PS C:\> Get-DbaAvailabilityGroup -SqlInstance sqlserver2014a | Select-Object *

Returns full object properties on all Availability Group(s) on sqlserver2014a.

Expand Down
2 changes: 1 addition & 1 deletion functions/Get-DbaClientProtocol.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function Get-DbaClientProtocol {
Gets the SQL Server related client protocols on computers sql1 and sql2, and shows them in a grid view.

.EXAMPLE
PS C:\> (Get-DbaClientProtocol -ComputerName sql2 | Where { $_.DisplayName = 'via' }).Disable()
PS C:\> (Get-DbaClientProtocol -ComputerName sql2 | Where-Object { $_.DisplayName = 'via' }).Disable()

Disables the VIA ClientNetworkProtocol on computer sql2.
If successful, return code 0 is shown.
Expand Down
2 changes: 1 addition & 1 deletion functions/Get-DbaCpuRingBuffer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function Get-DbaCpuRingBuffer {
Gets CPU Statistics from sys.dm_os_ring_buffers for server sql2008 for last 240 minutes

.EXAMPLE
PS C:\> $output = Get-DbaCpuRingBuffer -SqlInstance sql2008 -CollectionMinutes 240 | Select * | ConvertTo-DbaDataTable
PS C:\> $output = Get-DbaCpuRingBuffer -SqlInstance sql2008 -CollectionMinutes 240 | Select-Object * | ConvertTo-DbaDataTable

Gets CPU Statistics from sys.dm_os_ring_buffers for server sql2008 for last 240 minutes into a Data Table.

Expand Down
2 changes: 1 addition & 1 deletion functions/Get-DbaDbMail.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function Get-DbaDbMail {
Returns the db mail server object on sql01\sharepoint

.EXAMPLE
PS C:\> Get-DbaDbMail -SqlInstance sql01\sharepoint | Select *
PS C:\> Get-DbaDbMail -SqlInstance sql01\sharepoint | Select-Object *

Returns the db mail server object on sql01\sharepoint then return a bunch more columns

Expand Down
2 changes: 1 addition & 1 deletion functions/Get-DbaDbMailAccount.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function Get-DbaDbMailAccount {
Returns The DBA Team Database Mail account from sql01\sharepoint

.EXAMPLE
PS C:\> Get-DbaDbMailAccount -SqlInstance sql01\sharepoint | Select *
PS C:\> Get-DbaDbMailAccount -SqlInstance sql01\sharepoint | Select-Object *

Returns the Database Mail accounts on sql01\sharepoint then return a bunch more columns

Expand Down
2 changes: 1 addition & 1 deletion functions/Get-DbaDbMailConfig.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function Get-DbaDbMailConfig {
Returns the ProhibitedExtensions configuration on sql01\sharepoint

.EXAMPLE
PS C:\> Get-DbaDbMailConfig -SqlInstance sql01\sharepoint | Select *
PS C:\> Get-DbaDbMailConfig -SqlInstance sql01\sharepoint | Select-Object *

Returns the DBMail configs on sql01\sharepoint then return a bunch more columns

Expand Down
2 changes: 1 addition & 1 deletion functions/Get-DbaDbMailHistory.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function Get-DbaDbMailHistory {
Returns the entire DBMail history on sql01\sharepoint

.EXAMPLE
PS C:\> Get-DbaDbMailHistory -SqlInstance sql01\sharepoint | Select *
PS C:\> Get-DbaDbMailHistory -SqlInstance sql01\sharepoint | Select-Object *

Returns the entire DBMail history on sql01\sharepoint then return a bunch more columns

Expand Down
2 changes: 1 addition & 1 deletion functions/Get-DbaDbMailLog.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function Get-DbaDbMailLog {
Returns the entire DBMail log on sql01\sharepoint

.EXAMPLE
PS C:\> Get-DbaDbMailLog -SqlInstance sql01\sharepoint | Select *
PS C:\> Get-DbaDbMailLog -SqlInstance sql01\sharepoint | Select-Object *

Returns the entire DBMail log on sql01\sharepoint, includes all returned information.

Expand Down
2 changes: 1 addition & 1 deletion functions/Get-DbaDbMailProfile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function Get-DbaDbMailProfile {
Returns The DBA Team DBMail profile from sql01\sharepoint

.EXAMPLE
PS C:\> Get-DbaDbMailProfile -SqlInstance sql01\sharepoint | Select *
PS C:\> Get-DbaDbMailProfile -SqlInstance sql01\sharepoint | Select-Object *

Returns the DBMail profiles on sql01\sharepoint then return a bunch more columns

Expand Down
2 changes: 1 addition & 1 deletion functions/Get-DbaDbMailServer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function Get-DbaDbMailServer {
Returns The DBA Team DBMail server from sql01\sharepoint

.EXAMPLE
PS C:\> Get-DbaDbMailServer -SqlInstance sql01\sharepoint | Select *
PS C:\> Get-DbaDbMailServer -SqlInstance sql01\sharepoint | Select-Object *

Returns the DBMail servers on sql01\sharepoint then return a bunch more columns

Expand Down
2 changes: 1 addition & 1 deletion functions/Get-DbaDependency.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function Get-DbaDependency {
https://dbatools.io/Get-DbaDependency

.EXAMPLE
PS C:\> $table = (Get-DbaDatabase -SqlInstance sql2012 -Database Northwind).tables | Where Name -eq Customers
PS C:\> $table = (Get-DbaDatabase -SqlInstance sql2012 -Database Northwind).tables | Where-Object Name -eq Customers
PS C:\> $table | Get-DbaDependency

Returns everything that depends on the "Customers" table
Expand Down
2 changes: 1 addition & 1 deletion functions/Get-DbaEstimatedCompletionTime.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function Get-DbaEstimatedCompletionTime {
Gets estimated completion times for queries performed against the entire server

.EXAMPLE
PS C:\> Get-DbaEstimatedCompletionTime -SqlInstance sql2016 | Select *
PS C:\> Get-DbaEstimatedCompletionTime -SqlInstance sql2016 | Select-Object *

Gets estimated completion times for queries performed against the entire server PLUS the SQL query text of each command

Expand Down
2 changes: 1 addition & 1 deletion functions/Get-DbaIoLatency.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function Get-DbaIoLatency {
Get IO subsystem latency statistics for servers sql2008 and sqlserver2012.

.EXAMPLE
PS C:\> $output = Get-DbaIoLatency -SqlInstance sql2008 | Select * | ConvertTo-DbaDataTable
PS C:\> $output = Get-DbaIoLatency -SqlInstance sql2008 | Select-Object * | ConvertTo-DbaDataTable

Collects all IO subsystem latency statistics on server sql2008 into a Data Table.

Expand Down
4 changes: 2 additions & 2 deletions functions/Get-DbaLastBackup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ function Get-DbaLastBackup {
Returns a custom object with Server name, Database name, and the date the last time backups were performed.

.EXAMPLE
PS C:\> Get-DbaLastBackup -SqlInstance ServerA\sql987 | Select *
PS C:\> Get-DbaLastBackup -SqlInstance ServerA\sql987 | Select-Object *

Returns a custom object with Server name, Database name, and the date the last time backups were performed, and also recoverymodel and calculations on how long ago backups were taken and what the status is.

.EXAMPLE
PS C:\> Get-DbaLastBackup -SqlInstance ServerA\sql987 | Select * | Out-Gridview
PS C:\> Get-DbaLastBackup -SqlInstance ServerA\sql987 | Select-Object * | Out-Gridview

Returns a gridview displaying Server, Database, RecoveryModel, LastFullBackup, LastDiffBackup, LastLogBackup, SinceFull, SinceDiff, SinceLog, Status, DatabaseCreated, DaysSinceDbCreated.

Expand Down
2 changes: 1 addition & 1 deletion functions/Get-DbaLatchStatistic.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function Get-DbaLatchStatistic {
Check latch statistics on server sql2008 for thresholds above 98%

.EXAMPLE
PS C:\> $output = Get-DbaLatchStatistic -SqlInstance sql2008 -Threshold 100 | Select * | ConvertTo-DbaDataTable
PS C:\> $output = Get-DbaLatchStatistic -SqlInstance sql2008 -Threshold 100 | Select-Object * | ConvertTo-DbaDataTable

Collects all latch statistics on server sql2008 into a Data Table.

Expand Down
2 changes: 1 addition & 1 deletion functions/Get-DbaModule.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function Get-DbaModule {
Return all modules for servers sql2008 and sqlserver2012 sorted by Database, Modify_Date ASC.

.EXAMPLE
PS C:\> Get-DbaModule -SqlInstance sql2008, sqlserver2012 | Select *
PS C:\> Get-DbaModule -SqlInstance sql2008, sqlserver2012 | Select-Object *

Shows hidden definition column (informative wall of text).

Expand Down
2 changes: 1 addition & 1 deletion functions/Get-DbaMsdtc.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function Get-DbaMsdtc {
Get DTC status for all the computers in a .txt file

.EXAMPLE
PS C:\> Get-DbaMsdtc -Computername $Computers | where { $_.dtcservicestate -ne 'running' }
PS C:\> Get-DbaMsdtc -Computername $Computers | Where-Object { $_.dtcservicestate -ne 'running' }

Get DTC status for all the computers where the MSDTC Service is not running

Expand Down
2 changes: 1 addition & 1 deletion functions/Get-DbaServerProtocol.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function Get-DbaServerProtocol {
Gets the SQL Server related server protocols on computers sql1 and sql2, and shows them in a grid view.

.EXAMPLE
PS C:\> (Get-DbaServerProtocol -ComputerName sql1 | Where { $_.DisplayName = 'via' }).Disable()
PS C:\> (Get-DbaServerProtocol -ComputerName sql1 | Where-Object { $_.DisplayName = 'via' }).Disable()

Disables the VIA ServerNetworkProtocol on computer sql1.
If successful, return code 0 is shown.
Expand Down
2 changes: 1 addition & 1 deletion functions/Get-DbaSpinLockStatistic.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function Get-DbaSpinLockStatistic {
Get SpinLock Statistics for servers sql2008 and sqlserver2012.

.EXAMPLE
PS C:\> $output = Get-DbaSpinLockStatistic -SqlInstance sql2008 | Select * | ConvertTo-DbaDataTable
PS C:\> $output = Get-DbaSpinLockStatistic -SqlInstance sql2008 | Select-Object * | ConvertTo-DbaDataTable

Collects all SpinLock Statistics on server sql2008 into a Data Table.

Expand Down
2 changes: 1 addition & 1 deletion functions/Get-DbaWaitStatistic.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function Get-DbaWaitStatistic {
Check wait statistics on server sql2008 for thresholds above 98% and include wait stats that are most often, but not always, ignorable

.EXAMPLE
PS C:\> Get-DbaWaitStatistic -SqlInstance sql2008 | Select *
PS C:\> Get-DbaWaitStatistic -SqlInstance sql2008 | Select-Object *

Shows detailed notes, if available, from Paul's post

Expand Down
2 changes: 1 addition & 1 deletion functions/Get-DbaWsfcCluster.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function Get-DbaWsfcCluster {
Gets failover cluster information about cluster01

.EXAMPLE
PS C:\> Get-DbaWsfcCluster -ComputerName cluster01 | Select *
PS C:\> Get-DbaWsfcCluster -ComputerName cluster01 | Select-Object *

Shows all cluster values, including the ones not shown in the default view

Expand Down
2 changes: 1 addition & 1 deletion functions/Get-DbaWsfcNetworkInterface.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function Get-DbaWsfcNetworkInterface {
Gets network interface information from the failover cluster cluster01

.EXAMPLE
PS C:\> Get-DbaWsfcNetworkInterface -ComputerName cluster01 | Select *
PS C:\> Get-DbaWsfcNetworkInterface -ComputerName cluster01 | Select-Object *

Shows all network interface values, including the ones not shown in the default view

Expand Down
2 changes: 1 addition & 1 deletion functions/Get-DbaWsfcResource.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function Get-DbaWsfcResource {
Gets resource information from the failover cluster cluster01

.EXAMPLE
PS C:\> Get-DbaWsfcResource -ComputerName cluster01 | Select *
PS C:\> Get-DbaWsfcResource -ComputerName cluster01 | Select-Object *

Shows all resource values, including the ones not shown in the default view

Expand Down
2 changes: 1 addition & 1 deletion functions/Get-DbaWsfcRole.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function Get-DbaWsfcRole {
Gets role information from the failover cluster cluster01

.EXAMPLE
PS C:\> Get-DbaWsfcRole -ComputerName cluster01 | Select *
PS C:\> Get-DbaWsfcRole -ComputerName cluster01 | Select-Object *

Shows all role values, including the ones not shown in the default view

Expand Down
9 changes: 4 additions & 5 deletions functions/Import-DbaCsv.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -485,23 +485,22 @@ function Import-DbaCsv {
Write-Message -Level Verbose -Message "Starting bulk copy for $(Split-Path $file -Leaf)"

# Setup bulk copy options
$bulkCopyOptions = @()
[int]$bulkCopyOptions = ([System.Data.SqlClient.SqlBulkCopyOptions]::Default)
$options = "TableLock", "CheckConstraints", "FireTriggers", "KeepIdentity", "KeepNulls", "Default"
foreach ($option in $options) {
$optionValue = Get-Variable $option -ValueOnly -ErrorAction SilentlyContinue
if ($optionValue -eq $true) {
$bulkCopyOptions += "$option"
$bulkCopyOptions = $bulkCopyOptions -bor (Invoke-Expression "[System.Data.SqlClient.SqlBulkCopyOptions]::$option")
}
}
$bulkCopyOptions = $bulkCopyOptions -join " & "

if ($PSCmdlet.ShouldProcess($instance, "Performing import from $file")) {
try {
# Create SqlBulkCopy using default options, or options specified in command line.
if ($bulkCopyOptions) {
$bulkcopy = New-Object Data.SqlClient.SqlBulkCopy($oleconnstring, $bulkCopyOptions, $transaction)
$bulkcopy = New-Object Data.SqlClient.SqlBulkCopy($sqlconn, $bulkCopyOptions, $transaction)
} else {
$bulkcopy = New-Object Data.SqlClient.SqlBulkCopy($sqlconn, "Default", $transaction)
$bulkcopy = New-Object Data.SqlClient.SqlBulkCopy($sqlconn, ([System.Data.SqlClient.SqlBulkCopyOptions]::Default), $transaction)
}

$bulkcopy.DestinationTableName = "[$schema].[$table]"
Expand Down
2 changes: 1 addition & 1 deletion functions/Remove-DbaDbSnapshot.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ function Remove-DbaDbSnapshot {
Removes HR_snapshot and Accounting_snapshot

.EXAMPLE
PS C:\> Get-DbaDbSnapshot -SqlInstance sql2016 | Where SnapshotOf -like '*dumpsterfire*' | Remove-DbaDbSnapshot
PS C:\> Get-DbaDbSnapshot -SqlInstance sql2016 | Where-Object SnapshotOf -like '*dumpsterfire*' | Remove-DbaDbSnapshot

Removes all snapshots associated with databases that have dumpsterfire in the name

Expand Down
4 changes: 2 additions & 2 deletions functions/Remove-DbaSpn.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ function Remove-DbaSpn {
Connects to Active Directory and removes a provided SPN to the given account. Uses alternative account to connect to AD.

.EXAMPLE
PS C:\> Test-DbaSpn -ComputerName sql2005 | Where { $_.isSet -eq $true } | Remove-DbaSpn -WhatIf
PS C:\> Test-DbaSpn -ComputerName sql2005 | Where-Object { $_.isSet -eq $true } | Remove-DbaSpn -WhatIf

Shows what would happen trying to remove all set SPNs for sql2005 and the relative delegations

.EXAMPLE
PS C:\> Test-DbaSpn -ComputerName sql2005 | Where { $_.isSet -eq $true } | Remove-DbaSpn
PS C:\> Test-DbaSpn -ComputerName sql2005 | Where-Object { $_.isSet -eq $true } | Remove-DbaSpn

Removes all set SPNs for sql2005 and the relative delegations

Expand Down
2 changes: 1 addition & 1 deletion functions/Rename-DbaDatabase.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ function Rename-DbaDatabase {
https://dbatools.io/Rename-DbaDatabase

.EXAMPLE
PS C:\> Rename-DbaDatabase -SqlInstance sqlserver2014a -Database HR -DatabaseName HR2 -Preview | select *
PS C:\> Rename-DbaDatabase -SqlInstance sqlserver2014a -Database HR -DatabaseName HR2 -Preview | Select-Object *

Shows the detailed result set you'll get renaming the HR database to HR2 without doing anything

Expand Down
4 changes: 2 additions & 2 deletions functions/Set-DbaSpn.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ function Set-DbaSpn {
Connects to Active Directory and adds a provided SPN to the given account, without the delegation.

.EXAMPLE
PS C:\> Test-DbaSpn -ComputerName sql2016 | Where { $_.isSet -eq $false } | Set-DbaSpn
PS C:\> Test-DbaSpn -ComputerName sql2016 | Where-Object { $_.isSet -eq $false } | Set-DbaSpn

Sets all missing SPNs for sql2016

.EXAMPLE
PS C:\> Test-DbaSpn -ComputerName sql2016 | Where { $_.isSet -eq $false } | Set-DbaSpn -WhatIf
PS C:\> Test-DbaSpn -ComputerName sql2016 | Where-Object { $_.isSet -eq $false } | Set-DbaSpn -WhatIf

Displays what would happen trying to set all missing SPNs for sql2016

Expand Down
2 changes: 1 addition & 1 deletion functions/Test-DbaDeprecatedFeature.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function Test-DbaDeprecatedFeature {
Check deprecated features on server sql2008 for only the testdb and db2 databases

.EXAMPLE
PS C:\> Get-DbaDatabase -SqlInstance sql2008 -Database testdb, db2 | Test-DbaDeprecatedFeature | Select *
PS C:\> Get-DbaDatabase -SqlInstance sql2008 -Database testdb, db2 | Test-DbaDeprecatedFeature | Select-Object *

See the object definition in the output as well

Expand Down
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ $startDbaMigrationSplat = @{
Exclude = 'BackupDevice','SysDbUserObjects','Credentials'
}

Start-DbaMigration @startDbaMigrationSplat -Force | Select * | Out-GridView
Start-DbaMigration @startDbaMigrationSplat -Force | Select-Object * | Out-GridView

# Know how snapshots used to be a PITA? Now they're super easy
New-DbaDbSnapshot -SqlInstance $new -Database db1 -Name db1_snapshot
Expand All @@ -101,7 +101,7 @@ Remove-DbaDbSnapshot -SqlInstance $new -Snapshot db1_snapshot # or -Database db1
$old | Get-DbaLastGoodCheckDb | Out-GridView

# Here's how you can find your integrity jobs and easily start them. Then, you can watch them run, and finally check your newest DBCC CHECKDB results
$old | Get-DbaAgentJob | Where Name -match integrity | Start-DbaAgentJob
$old | Get-DbaAgentJob | Where-Object Name -match integrity | Start-DbaAgentJob
$old | Get-DbaRunningJob
$old | Get-DbaLastGoodCheckDb | Out-GridView

Expand Down Expand Up @@ -132,7 +132,7 @@ Invoke-DbaDbClone -SqlInstance $new -Database db1 -CloneDatabase db1_clone | Out

# Read and watch XEvents
Get-DbaXESession -SqlInstance $new -Session system_health | Read-DbaXEFile
Get-DbaXESession -SqlInstance $new -Session system_health | Read-DbaXEFile | Select -ExpandProperty Fields | Out-GridView
Get-DbaXESession -SqlInstance $new -Session system_health | Read-DbaXEFile | Select-Object -ExpandProperty Fields | Out-GridView

# Reset-DbaAdmin
Reset-DbaAdmin -SqlInstance $instance -Login sqladmin -Verbose
Expand Down
4 changes: 2 additions & 2 deletions tests/Get-DbaModule.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ Describe "$CommandName Integration Tests" -Tags "IntegrationTests" {
# SQL2008R2SP2 will return a number of modules from the msdb database so it is a good candidate to test
$results = Get-DbaModule -SqlInstance $script:instance1 -Type View -Database msdb
It "Should only have one type of object" {
($results | Select -Unique Database | Measure-Object).Count | Should Be 1
($results | Select-Object -Unique Database | Measure-Object).Count | Should Be 1
}

It "Should only have one database" {
($results | Select -Unique Type | Measure-Object).Count | Should Be 1
($results | Select-Object -Unique Type | Measure-Object).Count | Should Be 1
}
}
}
2 changes: 1 addition & 1 deletion tests/Test-DbaDbRecoveryModel.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Describe "$CommandName Intigration Tests" -Tag "IntegrationTests" {
}

Context "Psudo Simple Recovery" {
$results = Test-DbaDbRecoveryModel -SqlInstance $script:instance2 -RecoveryModel Full | Where {$_.database -eq "$psudoSimpleRecovery"}
$results = Test-DbaDbRecoveryModel -SqlInstance $script:instance2 -RecoveryModel Full | Where-Object {$_.database -eq "$psudoSimpleRecovery"}

It "Should return $psudoSimpleRecovery" {
$results.Database | should -Be "$psudoSimpleRecovery"
Expand Down