How to run PowerShell script into another Windows server (remotely)

This is a really simple article, which provides a PowerShell script that I really need to use to run another PowerShell script into another Windows server.

So I had a server that an SSIS package was running into the catalogs but the PowerShell script in the package was in another server, so in order to run without errors, we need to call the first PowerShell script that will call the second and script and the one that you needed.

So for that we are using the Enter-PSSession function by giving the server name and the credentials to connect to it.
The documentation of this function can be found here: Enter-PSSession (Microsoft.PowerShell.Core) — PowerShell | Microsoft Docs

PowerShell script example

It’s a really simple PS1 script that can be found on my GitHub reporitory:
guimatheus92/Run-PowerShell-Script-Into-Another-Server (github.com)

I hope you enjoyed this simple solution.

Mechanical Engineer Business Intelligence developer, passionate about technology, I have knowledge and experience to create a BI architecture and much more 📚.