Powershell and SQL Server – 1- Import SQLPS Module

Ways to connect to SQL Server using Powershell

Microsoft recommend to use SQLPS Module to manage SQL Server.Import the SQLPS Module into Windows Powershell environment

Check if SQLPS module is registered and available

Get-Module

Powershell1

Import SQLPS Module to Powershell console

Import-Module SQLPS

Powershell2

Ignore Warnings

Powershell3

Ignore the Module Load if already loaded

if (-not (Get-Module SQLPS)) {Import-Module SQLPS}

List out SQLPS Commands

Get-Command

Leave a Reply

Your email address will not be published. Required fields are marked *