In the previous tip we used netsh.exe to determine the Wi-Fi signal strength. Since netsh.exe returns raw text output, it takes a lot of text...
ps1
Identifying Wi-Fi Signal Strength (Part 1)
Provided you are connected to a wireless network, then the following one-liner gets you the current signal strength: PS> @(netsh wlan show...
How Linux protects SecureStrings (Not)
When you serialize objects to XML in PowerShell on a non-Windows system, i.e. by using Export-CliXml, any SecureString data is encoded only, not...
Quickly Initializing Multiple PowerShell Consoles
Let’s say you are admin in many areas, i.e. Azure, SharePoint, SQL, Microsoft 365, you name it. For each environment, you may need to run some...
Identifying Group Memberships
If your script needs to know whether the current user is member in a given group, then the fastest and least resource intense approach for this is...
Finding System Paths
Occasionally, your script needs to know the path to the users’ desktop, or to the start menu, etc. These paths can vary, especially when users...
Working with NTFS Streams (Part 5)
In previous tips we looked at NTFS streams, and you discovered how Windows marks downloaded files with Zone Information streams. You also learned to...
Working with NTFS Streams (Part 4)
Whenever you download a file from the Internet (or other sources deemed untrusted) and store it on a NTFS drive, Windows silently marks such files...
Working with NTFS Streams (Part 3)
In the previous tip we explained how NTFS streams work. However, it wasn’t possible to discover the names of hidden file streams. In...
Working with NTFS Streams (Part 2)
In the previous tip we explained how NTFS streams can store additional data about a file which raises the question how you can delete such streams,...
Working with NTFS Streams (Part 1)
On NTFS file systems, you can store extra information in hidden file streams. Traditionally, PowerShell accesses file streams via colons, so this...
Watching German TV Shows
German public broadcasting companies maintain rich TV archives and let users view their shows through web interfaces. There is typically no way to...
Finding Last Logged-on User
To find details about the last logged-on user on Windows, you can query the registry: Get-ItemProperty...
Using BITS to Download Files (Part 2)
BITS (Background Intelligent Transfer System) is the technique used by Windows to download huge files such as operating system updates. You can use...
Using BITS to Download Files (Part 1)
BITS (Background Intelligent Transfer System) is the technique used by Windows to download huge files such as operating system updates. You can use...
Investigating PowerShell Console Output
When you see results from commands in the PowerShell console, typically only part of the information is displayed. To see the complete information,...
Identifying Origin of Network Access
Get-NetTCPConnection returns all current TCP network connections, but this cmdlet won’t tell you exactly who is connecting to your machine....
Exploring Folder Structures (Part 2)
With just a couple of cmdlets, you can examine folder structures and i.e. return the sizes of subfolders in a folder tree. Here is an example that...
Exploring Folder Structures (Part 1)
Here is a quick sample illustrating how you can discover folder structures. This example takes any root folder path and recursively traverses...
Saving Text Files without BOM
On Windows, by default many cmdlets encode text files with a BOM (Byte Order Mask) encoding. BOM writes some extra bytes at the beginning of a text...
Trusting Self-Signed HTTPS Certificates
If you need to access HTTPS websites that use a self-signed test certificate or a certificate that has expired or is otherwise not trustworthy,...
Converting Word Documents
There are still floating around numerous Microsoft Office documents in old file formats (.doc instead of .docx). Here is a simple PowerShell...
Using Encoding Standards
When working with text files, it is important to always use the same text encoding for reading and writing or else special characters can be...
Fixing VSCode PowerShell Issues (Part 2)
If VSCode won’t launch a PowerShell engine when editing a PowerShell script and instead the yellow message “Starting PowerShell”...