Loading the SQL Server Management Objects (SMO)
function loadSMO{ $ErrorActionPreference = "Stop" $sqlpsRegistry="HKLM:\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.SqlServer.Management.PowerShell.sqlps" try{ if (Get-ChildItem $sqlpsRegistry -ErrorAction "SilentlyContinue") { throw "SQL…
0 Comments