PowerShell Basics
PowerShell allows you to control or manage systems using the command line or run automated operations via Powershell scripts.
What is PowerShell?
PowerShell is a cross-platform command-line console and scripting language that can be used to manage systems, configure them, or automate tasks. Simply described, PowerShell consists of an input window in which specific commands can be executed via text input. The commands can be combined and started for automatic processes from a text file. When commands or functions are started from a text file, it is called a PowerShell script.
What can PowerShell be used for?
PowerShell is predominantly used by administrators in Microsoft Windows or Azure. In addition to administrative tasks, PowerShell can also be used for automatic operations in the form of custom commands (cmdlets) or by creating PowerShell scripts. Its use is not limited to Microsoft Windows, but is also possible in a Linux distribution.
What is the difference between Command Prompt and PowerShell?
PowerShell is considered the successor of the Command Prompt and thus of Windows Batch. Even scripts that were originally written in VBScript are now mostly implemented in PowerShell. In contrast to its predecessors, PowerShell is object-oriented, works with pipes and filters and provides new possibilities thanks to its modular structure. Basically, the way PowerShell works is similar to the command prompt: enter command and start with ENTER. Commands that work in the command prompt can mostly also be called in PowerShell. In PowerShell, it does not matter whether the commands are in upper or lower case. The commands in Power Shell are called cmdlets. For some MS-DOS commands (command prompt) there are aliases to the Windows PowerShell cmdlets. For example, if the command "dir" is called, PowerShell starts the following command: Get-ChildItem. Thus, Get-ChildItem also listens for the name dir. Aliases can be invoked with the Get-Alias command. The name of PowerShell commands is composed of the combination "verb" - "noun", i.e. "action" and the "name" for what the action should be executed, as an example: Get-Help for fetch-help. An overview of the commands is given in thefollowing article: PowerShell Commands Overview. All available commands can be listed using get-command and help can be called using get-help CommandName, see: PowerShell Help Get-Help.
How can the PowerShell console be started?
The PowerShell console can be started by a simple search for the term "PowerShell".
For certain commands, especially for adjusting operating system settings, Windows PowerShell must be started as administrator:
If you start PowerShell more often, you can pin it to the taskbar:
read next: PowerShell Help | Get-Help
PowerShell Help | Get-Help
Probably the most important PowerShell command is Get-Help. With Get-Help the integrated PowerShell help can be called, it gives an overview of the function of the individual commands and their application, up to concrete examples. ... continue reading
Powershell console commands
To begin with, it is not always necessary to write a script for PowerShell. Especially for administrators the PowerShell console offers a possibility to execute certain tasks via commands. ... continue reading
PowerShell Version: get-host
The PowerShell version can be displayed with the get-host command. ... continue reading
PowerShell variables, data types and objects
Basics of PowerShell variables and their data types. ... continue reading
PowerShell Syntax: compare and nest
PowerShell uses so-called comparison operators for comparing values. Pipes can be used to pass different PowerShell commands to other commands. ... continue reading
PowerShell convert string / manipulation: substring etc.
In this article I show a few examples for manipulating strings (character strings) ... continue reading
Windows PowerShell Commands:Overview
the available PowerShell commands can be started with the command: ... continue reading
{{percentage}} % positive