Real-World Cross-Platform PowerShell Scripts
To come up with some real-world examples of cross-platform PowerShell scripts, I did a DuckDuckGo search for the PowerShell script examples Linux text string. The coolest thing I found is the Mega Collection of PowerShell Scripts on Github. You can use git
to download it by doing:
git clone https://github.com/fleschutz/PowerShell.git
Once it’s downloaded, cd
into the PowerShell/scripts/
directory, and take a look at what’s there. For our first example, let’s look at something simple that will run on all platforms.
The write-marquee.ps1 Script
The write-marquee.ps1
script is truly cross-platform, because it doesn’t use any commands that are specific to any particular operating system. All it does is create a marquee message that flows across on your screen. I can’t show the entire script here, but you can look at your own local copy. So, let’s just look at the individual parts of...