FIND YOUR NEXT FEW LINES

Results for “Set-Content”

Small, practical examples. Search by task or narrow things down below.

604 snippets foundClear filters
GitRestoring & revising local work

Remove only a named untracked scratch file

Git: Use a narrow pathspec after reviewing the dry run; clean cannot recover untracked content.

Git✓ Tested
GitStashing selected work

Restore the index state recorded in a stash

Git: Apply with index restores which changes were staged as well as their file contents.

Git✓ Tested
CSSBox dimensions & overflow

Add inner spacing to a content-sized box

CSS: In content-box sizing, padding adds to the declared content width.

CSS✓ Tested
CSSVisual treatment & accessibility

Align an image within its content box

CSS: Object-position places the rendered object when fitting leaves spare space or crops an edge.

CSS✓ Tested
CSSGetting Started

Allow long content to scroll

CSS: Learn how to allow long content to scroll in a complete browser example.

CSS✓ Tested
PowerShellFile operations & integrity

Append a line while keeping earlier content

PowerShell: Add-Content appends using an explicitly selected encoding.

PowerShell✓ Tested
Bash ScriptsParameter expansion

Assign a default to an empty or unset variable

Bash Scripts: The colon-equals expansion both supplies and assigns a fallback value.

Bash Scripts✓ Tested
Arduino / CData & storage

Average a fixed set of readings

Accumulate sample values without overflowing a 16-bit total.

array✓ Tested
AngularTemplates & bindings

Bind textContent without interpreting markup

Bind textContent without interpreting markup with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
JavaEncoding & structured values

Calculate a SHA-256 content digest

Java: Hash UTF-8 bytes and format the result as lowercase hexadecimal.

Java✓ Tested
CSSLayout

Center content with flexbox

Center a child along both axes inside a CSS flex container.

CSS✓ Tested
Bash ScriptsDiagnostics & defensive scripting

Check whether a variable exists under nounset

Bash Scripts: The plus expansion distinguishes an unset variable without reading its missing value.

Bash Scripts✓ Tested