Microsoft's PowerShell for Linux
.NET Core: Slimmed-Down .NET
In PowerShell's documentation for Linux and Mac OS, the Microsoft developers point out that Windows admins on Linux will not find all of the usual PowerShell commands. PowerShell for Linux is not based directly on the large .NET framework, but on a slimmed-down version called .NET Core. For example, the PowerShell functions referring to the Windows interface do not exist on Linux systems or Mac OS computers. Similarly, several cmdlets that Windows admins will be familiar with from their usual environment are absent from PowerShell for Linux.
The slimmed-down .NET version is also important in another respect: If you find cmdlets or scripts for PowerShell on the Internet, you can generally expect the Windows PowerShell to run the script correctly. Ultimately, cmdlets are simply .NET classes that include other, commonly available .NET classes. If a class referenced in the script is missing from the .NET Core collection, it won't run in PowerShell for Linux.
OMI – The Rebirth of WMI
Another component that PowerShell relies on in the background, and that is lacking on Linux systems, is Windows Management Instrumentation (WMI). WMI performs important computer-management tasks on Windows systems. Windows hosts can be automatically administrated via WMI, for instance, by rolling out the code on the target system.
WMI is Microsoft's method for realizing the principle of Web-Based Enterprise Management (WBEM) and implementing an interface for the Common Information Model (CIM) according to DMTF standards. PowerShell's open source properties cease when it comes to the topic of WMI. The PowerShell extensions related to WMI are not in the open source part of PowerShell and therefore don't work in the Linux version.
Microsoft is promising to offer a solution for the lack of WMI support; the company currently refers users to DSC for Linux , which has been available for quite a while now. The idea behind DSC is to compensate for the lack of WMI functionality with OMI. OMI, the Open Management Infrastructure, is an alternative to WMI by the Open Group, and it is available online as a free download. DSC lets PowerShell execute tasks on Linux similar to those performed on Windows via WMI.
DSC: Desired State Configuration
The component within PowerShell that prepares other computers using a preset configuration is called Desired State Configuration (DSC). Microsoft had already released a limited version of DSC for Linux in 2015. Like Puppet, DSC implements declaratively-formulated settings alongside the admin instructions on the host. Another similarity with Puppet is that DSC is idempotent, meaning that it delivers the same result with multiple runs as with one simple run.
An interesting fact about DSC is that it also works similarly to Puppet under the hood. You supply the desired configuration in the form of a config document (MOF file), then transfer it from its PowerShell environment to the Linux machine via a push command. The PowerShell documentation on DSC demonstrates a solid example for creating a file in /tmp
on the target host.
However, that naturally has little to do with the practical reality. While WMI is adjusted for the system on Windows hosts, the OMI-based approach currently remains more or less useless in its effect for Linux and Mac OS. It remains to be seen whether Microsoft is looking to develop DSC for Linux into a proper management tool, or whether in the end the field will be left to established solutions such as Puppet.
As previously mentioned, DSC for Linux was originally a low-priority effort from Microsoft, with the company implementing the necessary PowerShell commands as Python scripts. With the publication of PowerShell for Linux, they have avoided such a necessity. For the foreseeable future, Microsoft is likely to continue to offer DSC on Linux from the real PowerShell.
With the exception of DSC, little is going on with PowerShell in its first version for Linux. WinRM functionality is not present, which means it is not possible to use PowerShell to send a computer remote commands – a PowerShell equivalent to SSH functionality is simply not available for Linux. Microsoft has at least recognized this problem and has promised to address it. However, it is impossible to predict how the implementation will look in practice. Microsoft is presumably relying on established protocols such as OpenSSH for the solution. Altogether, PowerShell is likely to develop in the future into a universal tool aimed at Windows and Linux systems equally.
« Previous 1 2 3 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Direct Download
Read full article as PDF:
Price $2.95
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
News
-
An All-Snap Version of Ubuntu is In The Works
Along with the standard deb version of the open-source operating system, Canonical will release an-all snap version.
-
Mageia 9 Beta 2 Ready for Testing
The latest beta of the popular Mageia distribution now includes the latest kernel and plenty of updated applications.
-
KDE Plasma 6 Looks to Bring Basic HDR Support
The KWin piece of KDE Plasma now has HDR support and color management geared for the 6.0 release.
-
Bodhi Linux 7.0 Beta Ready for Testing
The latest iteration of the Bohdi Linux distribution is now available for those who want to experience what's in store and for testing purposes.
-
Changes Coming to Ubuntu PPA Usage
The way you manage Personal Package Archives will be changing with the release of Ubuntu 23.10.
-
AlmaLinux 9.2 Now Available for Download
AlmaLinux has been released and provides a free alternative to upstream Red Hat Enterprise Linux.
-
An Immutable Version of Fedora Is Under Consideration
For anyone who's a fan of using immutable versions of Linux, the Fedora team is currently considering adding a new spin called Fedora Onyx.
-
New Release of Br OS Includes ChatGPT Integration
Br OS 23.04 is now available and is geared specifically toward web content creation.
-
Command-Line Only Peropesis 2.1 Available Now
The latest iteration of Peropesis has been released with plenty of updates and introduces new software development tools.
-
TUXEDO Computers Announces InfinityBook Pro 14
With the new generation of their popular InfinityBook Pro 14, TUXEDO upgrades its ultra-mobile, powerful business laptop with some impressive specs.