PowerShell

Diese Seite gibt es auch in Deutsch

In the modern world, everyone strives for automation. Automating everyday tasks increases efficiency and can avoid errors caused by repetitive monotonous work. PowerShell can be used to automate such mundane tasks.

PowerShell is the latest command line interpreter from Microsoft and largely replaces its predecessors - the Command Prompt, Windows Batch as well as VBScript.
The syntax of PowerShell is reminiscent of that of the Unix shell. PowerShell works with pipes and filters, is object-oriented and, in addition to the actual console, is a cross-platform scripting language with the help of which systems can be managed, configured or tasks automated.

Current PowerShell version:  7.2.6 (found: 2022-08-12)


Stories for "PowerShell"

Preview PowerShell Basics

PowerShell Basics

created: 2022-05-02 from Bernhard

Windows PowerShell is simply described as an input window in which certain commands can be executed via text input. In addition, several commands or processes can be started via a text file.: Create and run Windows PowerShell script. PowerShell is considered the successor of the command prompt and thus of Windows Batch. Scripts that were originally written in VBScript are now mostly implemented in PowerShell. ... continue reading

Preview PowerShell Help | Get-Help

PowerShell Help | Get-Help

created: 2022-05-02 from Bernhard

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

Preview PowerShell Version: get-host

PowerShell Version: get-host

changed: 2022-08-12 from Bernhard (Initial Release: 2022-05-02)

The PowerShell version can be displayed with the get-host command. ... continue reading

Preview Powershell console commands

Powershell console commands

created: 2022-05-02 from Bernhard

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

Preview Create and run a Windows PowerShell Script

Create and run a Windows PowerShell Script

created: 2022-05-02 from Bernhard

In the simplest case, a PowerShell script is a text file containing a series of PowerShell commands. A PowerShell script is understood to be a file with the extension .ps1. The script file can contain a collection of commands, functions or cmdlets. ... continue reading

Preview PowerShell editors in comparison: ISE, Visual Studio Code

PowerShell editors in comparison: ISE, Visual Studio Code

created: 2022-05-02 from Bernhard

Choosing the right editor can significantly simplify development, even though PowerShell scripts can theoretically be created in any text editor. The advantages of a PowerShell-optimized editor include syntax highlighting, auto-completion, code snippets, and a debugging mode that can step through the script line-by-line and analyze specific areas. For a long time, the standard PowerShell editor was the Windows-integrated PowerShell ISE, which does a good job especially for debugging ,but the IS... ... continue reading

Preview PowerShell: Cmdlet (enhanced Function)

PowerShell: Cmdlet (enhanced Function)

created: 2022-05-02 from Bernhard

In PowerShell ISE a template for a PowerShell cmdlet can be inserted with Ctrl+J. The template extends the script with elements for documentation and thus gives the integrated PowerShell help all necessary information for the cmdlet: "get-help". ... continue reading

Preview PowerShell - Best Practice - creating better scripts

PowerShell - Best Practice - creating better scripts

created: 2022-05-02 from Bernhard

PowerShell offers relatively much freedom in designing the scripts. In order to write scripts in a readable and understandable way, it is advantageous if certain rules are followed. In PowerShell, comments can be inserted to explain the code, or information about the script and help can be stored in the header of a cmdlet, and the possible parameters can be documented. Thegoal should be that the code is written as self-explanatory as possible, which makes some comments unnecessary and simplifies... ... continue reading

Preview PowerShell Cmdlet Help

PowerShell Cmdlet Help

created: 2022-05-02 from Bernhard

Help in a custom cmdlet is a simple comment block at the beginning of a function, or at the beginning of a PowerShell script file. ... continue reading

Preview PowerShell passing of variables (param)

PowerShell passing of variables (param)

created: 2022-05-02 from Bernhard

  ... continue reading

Preview PowerShell variables, data types and objects

PowerShell variables, data types and objects

created: 2022-05-02 from Bernhard

Basics of PowerShell variables and their data types. ... continue reading

Preview PowerShell convert string / manipulation: substring etc.

PowerShell convert string / manipulation: substring etc.

created: 2022-05-02 from Bernhard

 In this article I show a few examples for manipulating strings (character strings)  ... continue reading

PowerShell Syntax: compare and nest

PowerShell Syntax: compare and nest

created: 2022-05-02 from Bernhard

PowerShell uses so-called comparison operators for comparing values. Pipes can be used to pass different PowerShell commands to other commands. ... continue reading

PowerShell if else and switch

PowerShell if else and switch

created: 2022-05-02 from Bernhard

Test conditions with the commands if, elseif, else and switch and execute a command if they apply: if, else, ... then ... continue reading

PowerShell Loops and Array

PowerShell Loops and Array

created: 2022-05-02 from Bernhard

An array stores multiple values, similar to a 2-column table. ... continue reading

Preview PowerShell text file and csv read / write

PowerShell text file and csv read / write

created: 2022-05-02 from Bernhard

PowerShell text file and csv read / write ... continue reading

PowerShell Hashtable vs Array vs Dictionary

PowerShell Hashtable vs Array vs Dictionary

created: 2022-05-02 from Bernhard

If you want to store specific values for an array, you will reach the limits with arrays. A hashtable is similar to an array, but stores a value for each entry. (similar to the vbscript: Dictionary) ... continue reading

PowerShell: Read Active Directory data

PowerShell: Read Active Directory data

created: 2022-08-19 from Bernhard

Using Windows PowerShell to read Active Directory objects. ... continue reading

PowerShell TCP Listener

PowerShell TCP Listener

created: 2022-08-12 from Bernhard

PowerShell uses the following commands to open a socket on a specific port via System.NET: ... continue reading

PowerShell Log-Files: Logging into a textfile - write to file

PowerShell Log-Files: Logging into a textfile - write to file

created: 2022-05-05 from Bernhard

Log files in PowerShell can be created via the Out-File command, via a custom function, or via PowerShell's built-in Transcript. ... continue reading

PowerShell: File attributes: Change date - without any tools.

PowerShell: File attributes: Change date - without any tools.

created: 2022-05-03 from Bernhard

As an alternative to special programs, the date of a file or folder can also be changed with PowerShell.  ... continue reading

Preview PowerShell - Handling passwords.

PowerShell - Handling passwords.

created: 2022-05-02 from Bernhard

Of course, passwords should never be stored in plain text in a script file. PowerShell offers possibilities for a secure handling of passwords. As an example, a password for a specific user can be stored encrypted as a text file. Only the respective user can decrypt the file, for other users the file is worthless. ... continue reading

PowerShell read Eventlog

PowerShell read Eventlog

created: 2022-05-02 from Bernhard

With the command "Get-WinEvent" the Windows Eventlog can be accessed via PowerShell ... continue reading

Preview Powershell ISE - Snippet | Templates

Powershell ISE - Snippet | Templates

created: 2022-05-02 from Bernhard

Snippets are script templates. For example a "do-until" or "for" loop or a template for a cmdlet. By selecting a snippet, the sample code is inserted into the editor. Powershell ISE, see also: how to create a PowerShell script ... continue reading

Windows PowerShell Commands:Overview

Windows PowerShell Commands:Overview

created: 2022-05-02 from Bernhard

the available PowerShell commands can be started with the command: ... continue reading