PowerShell was developed more than 10 years ago by Microsoft to expand the power of its command line interface by coupling it with a management framework used to manage local and remote Windows, macOS, and Linux systems. By using the Component Object Model, Windows Management Instrumentation, and Common Information Model interface standards, PowerShell allows for managed elements of computing objects to be administered independently.
SEE: PowerShell: A cheat sheet (free PDF) (TechRepublic)
SEE: Top 5 programming languages for security admins to learn (free PDF) (TechRepublic)
Released as PowerShell 1.0 on Nov. 14, 2006, Microsoft developed PowerShell to address the shortcomings of its DOS-based CLI, particularly when managing objects using complex scripting languages.
By creating a new shell from the ground up, Microsoft effectively developed an extensible environment that would be powerful and flexible–it’s capable of automating management tasks and functioning as a dedicated scripting language for Microsoft-based software.
Through various revisions, PowerShell has added modules to extend functionality to new objects and new cmdlets for managing more resources, including Active Directory and Exchange Server. On Aug. 18, 2016, Microsoft announced that PowerShell was going open source and provided its source code to the public, adding support to Unix-based OSes, including Linux distros and OS X.
SEE: All of TechRepublic’s cheat sheets and smart person’s guides (TechRepublic)
PowerShell 7 is the newest version of PowerShell and serves as a replacement console for both the previous versions of PowerShell Core 6.x and the Windows-only PowerShell 5.1. The latter serves as the last supported version of the Windows-only version of PowerShell, with the development team aiming to condense all previous versions of PowerShell into one beginning with 7.0. This move brings PowerShell 7 into compatibility with previously unsupported cmdlets, further bringing it closer to parity for all supported operating system versions.
PowerShell includes several cmdlets with which to manage any number of system attributes, resources, and objects–far beyond the scope of this guide. The following are some of the most notable features, modules, and cmdlets.
PowerShell enables system administrators to manage and automate tasks across Windows, macOS, and Linux environments. Such tasks could include configuring servers, managing Active Directory, and deploying applications using cmdlets and scripts.
Another element that makes PowerShell useful for mundane IT tasks is its support for remote management, which allows users to execute commands on multiple machines without physical access. It is also compatible with REST APIs and JSON to facilitate interaction with web services and cloud platforms.
Along with IT professionals charged with system administration or cloud management, PowerShell can be used by security teams to automate tasks involved with penetration testing and ethical hacking.
SEE: Manage Active Directory with these 11 PowerShell scripts (TechRepublic Premium)
Additional resources
Until the release of Windows 95, Microsoft chose to run Windows over DOS since it was the de facto OS used on IBM-compatible computers. From Windows 95 on, Windows kept MS-DOS since some legacy applications still relied upon it.
MS-DOS also served as the means of administering devices through remote methods and by way of scripts that would be coded to automatically run tasks that were deemed repetitive and time-consuming to manage Windows computers.
MS-DOS was released in 1981, and Microsoft did not evolve its CLI (unlike its Unix-based competitors) until the initial development of PowerShell in 2006. In making this 25-year leap, PowerShell was designed as more than just a CLI replacement.
Microsoft created PowerShell as a management framework that combines both a command-line shell and scripting language that is built upon .NET and the .NET Core and used as a software framework to standardize code, develop powerful applications, and cross-platform management of systems in heterogeneous networks.
This results in PowerShell being used to manage hardware, software, and network objects at the command line while also allowing programmers to use its scripting capabilities to interface with any manageable attributes to share data between them–including outputting code to develop applications to scale–from one personal computer through large enterprises that span the globe.
Open-sourcing PowerShell allows for a cross-pollination of system administrators to manage multiple types of server OSes from just about any system. For example, I manage Windows servers from macOS or maintain Linux servers from Windows client machines.
This level of flexibility is unprecedented and will be useful in standardizing the management of different platforms across industries, especially when it comes to automating system management processes. PowerShell 7 scripts created on Linux systems will work identically on macOS and Windows systems, easing administrative overhead.
PowerShell affects all types of users, from end users looking to be more productive to administrators seeking a simpler, more powerful solution to manage devices locally and remotely to developers writing their applications to interface between hardware and software layers. PowerShell is the next step in Microsoft’s CLI evolution, but it also presents a major step toward unifying management processes across platforms that were previously quite disparate from one another.
PowerShell requires learning new commands, new syntax, and logic to reach its maximum potential. And yet, Microsoft is already bringing this point home by using PowerShell modules that integrate with enterprise applications such as Exchange, SQL, and Windows Server to extend functionality and manageability.
Adding to this is the explosive growth of cloud-based services, such as Azure from Microsoft. With many management features available via GUI from the web-based interface, PowerShell 7 adds management support through Azure modules, further allowing administration of cloud-based infrastructure, including Azure Active Directory, among many other resources through the CLI.
Before the shift to open source, PowerShell only affected Windows administrators and those using the Microsoft family of products; however, now, Linux and macOS administrators may leverage PowerShell’s open-source capabilities alongside Microsoft administrators to simplify management.
Additional resources
PowerShell has been available for use on Windows computers since 2006. Beginning with version 1.0, PowerShell was available for Windows XP SP2, Windows Vista, and Windows Server 2003 and 2008.
The latest version is PowerShell 7.4.6, released in October 2024. It is built on .NET 8.0.0 framework and is available for Windows 11, Windows 10 (build 1607 and higher), Windows Server 2016 and higher, Windows Server Nano (build 1809 and higher), macOS 12/13/14, Alpine 3.17, Debian 12, RHEL 8/9. Ubuntu 20.04/22.04.
Version 7.5.0 is also available as a pre-release.
Additional resources:
These are some of the alternatives to PowerShell.
PowerShell is integrated on all versions of Windows going as far back as Windows 7. It is also integrated on all versions of Windows Server going as far back as Windows Server 2008 R2.
Previous versions of Windows can run PowerShell, though it is available as an optional update and not integrated with the operating system as is the case in more recent versions.
To install or upgrade to the 5.1 version of PowerShell on Windows computers, the latest Windows Management Framework (WMF) installer must be downloaded. The version number on the WMF installer directly matches the version of PowerShell that will be installed. Currently, WMF 5.1 exists and may be downloaded from Microsoft’s website free of charge for Windows users.
To install or upgrade to the open-source version of PowerShell 7 on supported systems, such as macOS and Linux, visit the PowerShell GitHub repository to obtain the appropriate package that matches the target operating system. Additionally, the latest versions of PowerShell 7 may be installed using the system’s native CLI by entering the respective system’s command with administrative credentials.
SEE: Top 5 programming languages for systems admins to learn (free PDF) (TechRepublic)
TechRepublic has published several tutorials on how to get the most out of PowerShell. Check out these tips, as well as some PowerShell basics from Microsoft.
Learn more about PowerShell with the 2022 Windows PowerShell Certification Bundle from TechRepublic Academy.
For Windows, press Windows + S, type “PowerShell,” and select Windows PowerShell or PowerShell 7 from the results. You could also do Windows + R to open the Run dialog, then type powershell and press Enter. For elevated access, right-click on the PowerShell icon and select Run as Administrator.
Open the Terminal application or emulator on macOS or Linux, respectively, then type pwsh and press Enter. In this case, PowerShell must already have been installed. See the ‘How can I get PowerShell?‘ section to learn how to do this.
PowerShell is a scripting language, not a fully-fledged programming language like Python or C#, though it shares some similarities with traditional programming tools.
Scripting languages tend to run within another program or environment. They are designed for small, task-specific operations, while a programming language is more general-purpose and can be used to develop apps with broad functionality.
PowerShell is not typically used to create standalone software or apps, but advanced users can write reusable modules and complex scripts. Instead, most use it to simplify operations and boost productivity through automation. However, PowerShell enables users to execute commands and manipulate data in an object-oriented way, unlike many other scripting languages that rely on plain text output.
Fiona Jackson updated this article in January 2024.
Kaynak: https://www.techrepublic.com/article/powershell-cheat-sheet/
Web sitemizde ziyaretçilerimize daha iyi hizmet sağlayabilmek adına bazı çerezler kullanıyoruz. Web sitemizi kullanmaya devam ederseniz çerezleri kabul etmiş sayılırsınız.
Gizlilik Politikası