After my first post, some of you might be asking: “So, how do I actually work with PowerShell on a Linux server?” The answer is quite simple and short: You don’t – at least not directly on the server.
PowerShell on Linux natively provides several useful modules that serve as the foundation for most tasks. Once you’ve logged into your server via SSH, you can start the PowerShell session simply by running the pwsh
command.
You can list the installed modules using the Get-Module -ListAvailable
command, just like on any Windows system. On my server, the following modules were preinstalled:

- Microsoft.PowerShell.Archive – Allows you to work with ZIP archives.
- Microsoft.PowerShell.Host – Provides core functionality for the PowerShell host.
- Microsoft.PowerShell.Management – Cmdlets for managing file systems, processes, services, etc.
- Microsoft.PowerShell.PSResourceGet – Provides cmdlets to manage and install PowerShell resources.
- Microsoft.PowerShell.Security – Cmdlets for managing security features like certificates and permissions.
- Microsoft.PowerShell.Utility – Useful cmdlets for general tasks such as text processing or working with objects.
- PackageManagement – Manages software packages and sources, including NuGet.
- PowerShellGet – Allows you to install and manage PowerShell modules.
- PSReadLine – Provides enhanced command line features like syntax highlighting and auto-completion.
- ThreadJob – Enables running background jobs using multiple threads.
Additional modules can easily be installed from the PowerShell Gallery, giving you access to a vast repository of community and Microsoft-provided modules. However, before installing any module, it’s important to ensure that it is compatible with PowerShell 7. Some modules that were designed for earlier versions of PowerShell (such as Windows PowerShell 5.1) may not function as expected or may require modifications to work in PowerShell 7.
If you prefer to manage your own set of modules, you can also set up a private repository on your server. This allows you to host and use custom modules tailored to your specific needs.
For instance, in my case, I have set up a local repository called homerepo
on my Ubuntu server, as shown below:
# Example to register a local PowerShell repository
Register-PSRepository -Name "homerepo" -SourceLocation "/home/janab/homerepo" -InstallationPolicy Trusted
Now, to my use case: I wanted to migrate the interface to the World of Warcraft API from Blizzard from PHP to PowerShell. However, instead of working directly on the server, I chose a different approach.
On my Windows 10 PC, I installed XAMPP, which gave me a local Apache web server and a MySQL instance on my machine. This allowed me to write and test my scripts in the PowerShell ISE locally before transferring them to the server.
With WinSCP, you can easily sync a local folder with a directory on your server. It’s an efficient way to ensure that your scripts and files are up to date on both your development machine and the server.
One important thing to keep in mind is which side you have in focus within WinSCP when you hit the sync button. If you have a folder or file selected on the local side, everything will be uploaded from your local machine to the server. However, if you are focused on the server side, it will download everything from the server to your local machine.
When using the sync feature for the first time, I highly recommend keeping the Preview Changes option checked. This allows you to see what’s going to be synced before any changes are made, helping to avoid unwanted file overwrites or deletions.
An example from my own setup can be seen in the next image:

Once I was satisfied with the result, I simply transferred the scripts to the server using WinSCP and then executed them via SSH. Over time, I wrote two modules for the API and another small one for MySQL. Finally, I created CronJobs to automatically retrieve data from the API at scheduled times and insert it into the database.
In the next blog posts, I’ll go into more detail on how I created these modules, how the API integration works, and how the CronJobs ensure smooth automation.