Author: Alex

How to install Apache web server with PHP, MySQL and phpMyAdmin on Windows [updated: September 2024]

Table of contents 1. Windows web server 2. How to install Apache on Windows 3. How to install PHP on Windows 4. PHP 8 setup 5. How to install MySQL on Windows 6. How to install phpMyAdmin on Windows Conclusion Windows web server A web server is a program that is designed to process requests for websites and send website pages to users. The most...

How to read file contents in PowerShell. How to save file contents to a variable

Table of contents How to read file contents and display them on the screen How to read a file and save it to a variable How to read multiple files with a single Get-Content command Using wildcards with file names in Get-Content How to read a specified number of lines from the beginning of a file How to read a...

Analogs of cat, tail, head and wc in PowerShell

How to pass the contents of a file to a cmdlet in PowerShell In this article, we will look at how to get the contents of a file and send it to a cmdlet for processing or for display on the screen. In Bash on Linux, when you need to pass data from a file, commands either work with standard...

How to assign cmdlet output to a variable and How to use a variable with saved output

Table of contents How to save cmdlet output to a variable How to display the contents of a variable in Terminal How to process the contents of a variable using a cmdlet How to count the number of rows in a variable How to get an idea of ​​the contents of a variable without printing the entire results How to...

How to determine an object’s type in PowerShell

Table of contents 1. How to determine an Object's type in PowerShell 2. Determining the object type with .GetType() (as well as .GetType().Name and .GetType().FullName 3. How to get the object type with Get-Member 4. Checking object types with the -is and -isnot type operators 5. How to check the type of collection elements 6. The .GetType().IsArray property to test...

How to display the full user name in a domain and workstation in PowerShell and CMD

Contents 1. How to find the full name of a user on the local computer 1.1 net user $env:USERNAME 1.2 Get-WMIObject Win32_UserAccount 1.3 [adsi] 1.4 Displaying the user name in CMD 1.5 Full user name in the Windows registry 2. How to get the current Windows user display name from the command line (for computers that are part of a domain) 2.1...

How to add a ‘b’ prefix to a variable name in Python?

Strings with a ‘b’ prefix in Python Consider the following example: byte_string = b'test string' print(byte_string) These two strings will print: b'test string' Strings with a ‘b’ prefix are a sequence of bytes, i.e. a special type of data (such as strings, numbers, lists, etc.). Suppose we want to do something like this: variable_string = "test string" byte_string = b'variable_string'...

PowerShell: how to find only folders with Get-ChildItem

This post will show you how to list only folders and subfolders of a specific directory in PowerShell. We will use the Get-ChildItem cmdlet, which shows the children of a selected drive or directory. How to list only folders in Get-ChildItem To list only folders without files in PowerShell, use the Get-ChildItem cmdlet with the -Directory option. For example, the...

How to find large files in PowerShell (using Get-Childitem)

This tutorial will tell you how to find large files (more than 2GB, 3GB, 10GB, or any other size). And also how to list large files in PowerShell. To find files, we will use the Get-Childitem cmdlet. This cmdlet gets elements and child elements in one or more specified locations. The description of the cmdlet is quite convoluted – the...
Loading...
X