Apakah PowerShell Bekerja pada Sistem Operasi Lain selain Windows?

Daftar Isi:

Apakah PowerShell Bekerja pada Sistem Operasi Lain selain Windows?
Apakah PowerShell Bekerja pada Sistem Operasi Lain selain Windows?

Video: Apakah PowerShell Bekerja pada Sistem Operasi Lain selain Windows?

Video: Apakah PowerShell Bekerja pada Sistem Operasi Lain selain Windows?
Video: CARA MENGATASI BLUE SCREEN PADA WINDOWS 10 - YouTube 2024, Maret
Anonim
Ini bisa sangat membuat frustasi ketika profesor Anda mengatakan satu hal tentang PowerShell dan berbagai situs web tampaknya menawarkan bukti nyata yang bertentangan. Apakah PowerShell benar-benar bekerja pada sistem non-Windows atau tidak? Posting SuperUser Q & A saat ini memiliki jawaban atas pertanyaan pembaca yang bingung.
Ini bisa sangat membuat frustasi ketika profesor Anda mengatakan satu hal tentang PowerShell dan berbagai situs web tampaknya menawarkan bukti nyata yang bertentangan. Apakah PowerShell benar-benar bekerja pada sistem non-Windows atau tidak? Posting SuperUser Q & A saat ini memiliki jawaban atas pertanyaan pembaca yang bingung.

Sesi Tanya & Jawab Hari ini hadir untuk memberi kami SuperUser - subdivisi Stack Exchange, pengelompokan situs web Q & A berbasis komunitas.

Pertanyaan

Pembaca SuperUser FredSavage187 ingin tahu apakah PowerShell berfungsi pada sistem operasi lain selain Windows:

My computer science professor recently gave us a quiz and one of the questions was, “True or False: PowerShell works on Windows, Mac, and Linux”. The correct answer was “false” and he maintains that PowerShell is a Windows only thing. But I found a couple of websites that say otherwise:

PowerShell is open sourced and is available on Linux [Microsoft Azure Blog]

PowerShell Repository [GitHub]

Which one is actually correct? Does PowerShell work on Linux and Mac OS as well as Windows?

Apakah PowerShell berfungsi pada sistem operasi lain selain Windows?

Jawabannya

Kontributor SuperUser Ben N memiliki jawabannya untuk kami:

Yes. Much of PowerShell is.NET, so it can run on any operating system that has the Common Language Runtime (CLR). On Windows, that is the.NET Framework. For other operating systems, including Linux, you can use the CoreCLR, an open-source, cross-platform subset of the.NET Framework.

As you learned at the PowerShell repository on GitHub, quite a few operating systems and distributions are supported. For example, here are the instructions for Ubuntu and a demonstration:

Image
Image

One could argue that not all of PowerShell is available in non-Windows environments since some features depend on libraries found only in Windows. The ParsedHtml property on the HtmlWebResponseObject type returned by Invoke-WebRequest, for example, is only useful on Windows because it holds a COM object that comes from an unmanaged library, mshtml.dll to be specific. On other platforms, there is nothing there. And, of course, there are cmdlets to manage systems found only in Windows, like Modern apps (Get-AppxPackage, for example).

Still though, the PowerShell infrastructure works perfectly well on other operating systems, plenty of the cmdlets are usable anywhere, and support is only getting better.

Memiliki sesuatu untuk ditambahkan ke penjelasan? Bicaralah di komentar. Ingin membaca lebih banyak jawaban dari pengguna Stack Exchange yang paham teknologi lainnya? Lihat diskusi lengkap di sini.

Kredit Gambar: Jeff Hicks (Petri IT Knowledgebase)

Direkomendasikan: