private/SQLUtils.ps1
# # SQLPrivate.ps1 # function Get-SqlServerSmo { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true)] [string]$SQLServerName ) [System.Reflection.Assembly]::LoadWithPartialName('Microsoft.SqlServer.SMO') | Out-Null $sqlServerSmo = New-Object -TypeName Microsoft.SqlServer.Management.Smo.Server $SQLServerName return $sqlServerSmo } |