script-example.com

       

the quick introduction to common scripting languages, as well as sample scripts.

Diese Seite gibt es auch in Deutsch

📁 Topics

PowerShell

PowerShell

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.


Windows Batch

Windows Batch

Batch files can be used to automate simple processes in Microsoft Windows. Batch files use the commands of the command prompt, in the simplest case these cmd commands can be entered in a simple text file line by line, it is then executed one command after the other. Windows batch originate from the MS-DOS era. At that time batch files had the file extension .bat. Since Windows 2000 the extension .cmd is used. Additionally there is the possibility to use jump labels or variables, up to more compl...


📰 New Posts

Structure of a batch file Syntax: echo off cmd
Windows Batch /

Structure of a batch file Syntax: echo off cmd

created: 2022-09-23 from Bernhard

If you have created a batch file, you can write a command in each line, see: how to create a batch file - basics. The commands are executed in sequence when the file is started. The behavior of the output can be adjusted as follows: ... continue reading

how to create a batch file - basics
Windows Batch /

how to create a batch file - basics

created: 2022-09-23 from Bernhard

A simple batch file is a text file containing a set of command prompt commands. A simple editor is sufficient to create the batch file. A text file saved in Windows/DOS with the extension .cmd or .bat, can be executed directly. Especially for very simple processes, for example copying files or folders, batch files may still be easier than using PowerShell. At the latest, if commands should not be executed in sequence and certain if-queries, loops or functions are necessary, I would recommend the... ... continue reading

PowerShell: Read Active Directory data
PowerShell /

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 /

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

Preview PowerShell Version: get-host
PowerShell /

PowerShell version 7.2.6 released

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

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

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

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 /

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 editors in comparison: ISE, Visual Studio Code
PowerShell /

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

PowerShell if else and switch
PowerShell /

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

Preview PowerShell Help | Get-Help
PowerShell /

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: Cmdlet (enhanced Function)
PowerShell /

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 - Handling passwords.
PowerShell /

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