Images created with rich-text editors like TinyMCE often include width and height attributes. These values are useful because they describe how the image should appear. However, many layouts use global CSS rules like width: 100%, which silently override those attributes. The result is stretched images or broken proportions.
A better approach is to let both systems work together:
The key idea is simple. CSS should only force full width on images that do not define their own size. At the same time, height should never be fixed. Let the browser calculate it automatically.
This approach is safe, predictable, and works well for content feeds, articles, and mixed image sizes.
width and height keep their intended sizeheight: auto preserves the natural aspect ratioAvoid using object-fit: cover for normal content images, as it may cut off important parts. This solution keeps layouts clean, readable, and friendly for all screen sizes.
When PowerShell receives data from a web request, the real value comes from understanding what the response contains. Most web services return JSON, and PowerShell automatically converts this JSON into objects you can work with directly. This removes the need for manual parsing and allows you to focus on extracting useful information.
Learning how to explore these objects helps you debug faster, avoid mistakes, and confidently build automation that depends on external data.
When you run a web request using Invoke-RestMethod, the JSON response becomes a structured object. You can:
Think of the response as a structured document instead of plain text.
$response = Invoke-RestMethod -Uri "https://api.example.com/resource"
# See all available properties
$response | Get-Member
# Access a few common fields (example names)
$response.id
$response.status
$response.details.name
Sometimes it is easier to understand the structure when you see the data as formatted JSON again. PowerShell can convert the object back into readable JSON.
$response | ConvertTo-Json -Depth 10
This is especially useful when the data contains nested objects.
Large responses can be overwhelming. You can limit the output to only the first few lines for a quick preview.
$response | ConvertTo-Json -Depth 10 |
Out-String |
Select-Object -First 20
PowerShell automatically transforms JSON into usable objects. By exploring properties, viewing formatted JSON, and limiting output for quick previews, you can understand any response quickly and safely reuse the data in your scripts.
Have you ever run a command in PowerShell and wondered if it really worked or silently failed? Exit codes give you a simple way to know what happened. They are small numbers returned by a program when it finishes, and they tell you whether the task succeeded or not.
✔️ Exit Code 0 — Success
An exit code of 0 means everything worked as expected. The command or script completed without errors. This is the standard way most programs say, “All good.”
❌ Exit Code 1 — Error
An exit code of 1 usually means something went wrong. It does not always tell you exactly what failed, but it signals that the command did not complete successfully. Different tools may use this code for different kinds of errors.
How to check the exit code in PowerShell
After running an external command, you can read the last exit code with:
$LASTEXITCODE
How to set your own exit code
In a script, you can control the result:
exit 0 # success
exit 1 # error
Understanding exit codes helps you automate tasks, detect problems early, and build more reliable scripts. Even beginners can use this small feature to make smarter decisions in their workflows.
Good spacing makes a page easier to read and more pleasant to scan. But adding space before every heading can create unwanted gaps — especially when headings follow each other or appear at the top of a section. In this guide, you’ll learn a simple CSS technique to add space before headings only when it actually improves readability.
We want to add top spacing to headings when:
This keeps related headings visually grouped while still separating them from normal content like text, images, or lists.
Use the adjacent sibling selector (+) together with :not() to target only the headings that need spacing:
.app :not(h1, h2, h3) + h1,
.app :not(h1, h2, h3) + h2,
.app :not(h1, h2, h3) + h3 {
margin-top: 20px;
}
:not(h1, h2, h3) selects any element that is not a heading.+ h1, + h2, + h3 selects a heading that comes directly after that element.This means:
You can fine-tune the spacing for each heading level:
This gives you more control over visual hierarchy.
A small CSS rule like this can make a big difference in how professional and readable your pages feel.
Calling web services is common in automation, monitoring, and integration tasks. Many APIs expect extra information in the request, such as authentication tokens, data formats, or custom settings. This information is sent through headers. Once you understand how headers work in PowerShell, you can safely connect to most modern services and build reliable scripts with confidence.
Headers describe how the server should handle your request. They can:
Without the correct headers, a request may fail or return unexpected data.
PowerShell uses a simple key-value structure called a hashtable. Each key is the header name, and the value is the header content. This hashtable is passed to the request using the -Headers parameter.
$headers = @{
"Authorization" = "Bearer YOUR_TOKEN"
}
Invoke-RestMethod -Uri "https://api.example.com/data" -Headers $headers
$headers = @{
"Authorization" = "Bearer YOUR_TOKEN"
"Content-Type" = "application/json"
"Accept" = "application/json"
}
Invoke-RestMethod -Uri "https://api.example.com/data" -Method Get -Headers $headers
$headers = @{
"Content-Type" = "application/json"
}
$body = @{
name = "Sample"
value = 123
} | ConvertTo-Json
Invoke-RestMethod -Uri "https://api.example.com/items" -Method Post -Headers $headers -Body $body
Create a hashtable for headers and attach it using -Headers. This approach works for most APIs and keeps your scripts clean, readable, and easy to maintain.
For advanced users, the Windows Registry can be modified to disable biometric features:
Press Windows + R, type regedit, and press Enter to open the Registry Editor.
Navigate to: HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Biometrics.
If the Biometrics key doesn't exist, create it:
Right-click on Microsoft, select New > Key, and name it Biometrics.
Within the Biometrics key, create a new DWORD (32-bit) value named Enabled.
Set the value of Enabled to 0.
Setting this value to 0 disables all biometric features, including facial recognition. To re-enable, change the value back to1.
Need to quickly see the current date and time in your Windows terminal? This simple how-to guide shows you exactly which commands to use in both Command Prompt and PowerShell. It is useful for beginners, scripting, logging, and everyday tasks.
Step 1: Open the Terminal
cmd, and press Enter for Command Prompt.Step 2: Show the Date and Time (Command Prompt)
Print only the date:
date /t
Print only the time:
time /t
Print both together:
echo %date% %time%
This is helpful when you want a quick timestamp in a script or log file.
Step 3: Show the Date and Time (PowerShell)
Display the current date and time:
Get-Date
Format the output:
Get-Date -Format "yyyy-MM-dd HH:mm:ss"
This creates a clean, readable timestamp like 2026-01-19 14:45:30.
💡 Tip
You can redirect these commands into a file to create simple logs.
Learning these small commands improves productivity and makes working in the Windows terminal easier and more efficient for daily tasks.
Sometimes data is created only to be logged and never used again. Creating intermediate lists or arrays in those cases increases memory usage and adds unnecessary complexity.
A summary string can often be built directly from the source data:
var summary =
string.Join(", ",
source.Select(x => x.Name));
logger.LogInformation("Items=[{Items}]", summary);
If the source might be null, a safe fallback avoids runtime errors:
var safeSource = source ?? Enumerable.Empty<Item>();
var summary =
string.Join(", ",
safeSource.Select(x => x.Name));
logger.LogInformation("Items=[{Items}]", summary);
This approach keeps the code lean while still producing clear, useful log output.
The choice between arrays and lists communicates intent and affects performance and safety.
When data is only needed for display or logging, an array represents a fixed snapshot and avoids accidental changes:
string[] names =
source.Select(x => x.Name).ToArray();
logger.LogInformation(
"Names=[{Names}]",
string.Join(", ", names));
Lists are useful when the collection must be modified or extended later:
var names =
source.Select(x => x.Name).ToList();
names.Add("NewItem");
Choosing the right type makes the code easier to understand and prevents unintended side effects.
When collections are logged directly, many logging systems only display the type name instead of the actual values. This makes it hard to understand what data was processed.
Converting the collection into a readable string solves this problem:
string[] values = { "One", "Two", "Three" };
var text = string.Join(", ", values);
logger.LogInformation("Values=[{Values}]", text);
To give additional context, the number of elements can also be logged:
logger.LogInformation(
"Count={Count}, Values=[{Values}]",
values.Length,
string.Join(", ", values));
Readable output improves troubleshooting and reduces the need to reproduce issues locally.