
This means you don’t need to make changes to any scripts that use these cmdlets. The v3 module also uses the same signatures as the RPS cmdlets. More performant - The connection establishment improves performance as it avoids setting up a PowerShell run space on the service.This minimizes failures due to network delays or longer query execution times. More reliable - REST API cmdlets handle transient failures with built-in retries.More secure - REST API cmdlets support modern authentication, so admins can turn off WinRM basic auth on their client machines.It is more secure, more reliable, and more performant. The v3 module has several advantages over earlier modules that use RPS-based cmdlets. x, so if you tried the preview version, you’ll find the v3 module familiar. The v3 module was previously in public preview as v2.0. The v3 module is an upgrade to the v2 module, which had Remote PowerShell (RPS)-based cmdlets and 9 REST-based cmdlets.

The v3 module has all REST-based cmdlets and it enables the use of Exchange Online cmdlets via REST API calls. All MSSQL commands are available until you close your PowerShell console or remove the module.The Exchange Online PowerShell v3 module (the v3 module) is now Generally Available. Try to query MS SQL database using Invoke-Sqlcmd. Then to use PowerShell cmdlets from this module, you just need to import them into the session:Īll SQL module cmdlets will be available without establishing an explicit connection to the remote computer. The cmdlet files themselves are not copied. The command creates a new RemoteSQLServer PowerShell module on your computer (in C:\Program Files\WindowsPowerShell\Modules). Invoke-Command -Session $sessionĮxport module cmdlets from the remote session to the local module:Įxport-PSSession -Session $s -CommandName *-Sql* -OutputModule RemoteSQLServer -AllowClobber Import-Module -PSsession $session -Name SqlServerĭon’t forget to close the session when you finish:Īnother interesting way to locally use a PowerShell module installed on a remote computer via Implicit remoting.Ĭonnect to a remote computer using the Invoke-Command and import the PowerShell module you want:

To import the specified PowerShell module to your computer: To display a list of modules installed on a remote computer: $session = New-PSSession -ComputerName dub-sql1 If you don’t want to install a PowerShell module on all computers, you can import any module from a remote computer using PSRemoting: Import PowerShell Module from a Remote Computer For obvious reasons, it doesn’t make sense to install AzureAD and Exchange Online PowerShell modules on offline devices.
