Powershell: Pull Cmdlets/Modules from remote server

by DigitalExpl0it
·
Published February 9, 2019
· Updated February 9, 2019

Sometimes you need certain cmdlets/modules installed to use with your PowerShell script, unfortunately you are unable to install the SDK/Console or you don’t wish to keep updating it on multiple locations. Using PowerShell PSSession to connect to a remote computer that already has the cmdlets and pull them into your session is a great alternative way to centralize the cmdlets in one location and never have to install anything. This guide will show you how to connect and pull in the cmdlets into your session without having to use invoke-command for every command. You can force TLS 1.2 in your script in case it is required, you can follow my guide here.