Results for “Files & paths”
Small, practical examples. Search by task or narrow things down below.
Run cleanup after a caught exception
PowerShell: Use finally for cleanup that must occur after either success or failure.
PowerShell✓ Tested
Run your first disposable container
Docker / Compose: Run your first disposable container using a locally available Ubuntu image.
Docker / Compose✓ Tested
Save and reload an image archive
Docker / Compose: save preserves image metadata and tags for later loading.
Docker / Compose✓ Tested
Select elements by an index range
PowerShell: An index range selects the requested array positions in order.
PowerShell✓ Tested
Select object properties
Create a smaller object with only the fields you need.
Select-Object✓ Tested
Select the first pipeline values
PowerShell: Select the first pipeline values using PowerShell 7.
PowerShell✓ Tested
Send text into a container through stdin
Docker / Compose: Send text into a container through stdin using a locally available Ubuntu image.
Docker / Compose✓ Tested
Separate an executable from default arguments
Docker / Compose: Separate an executable from default arguments with a complete introductory Dockerfile.
Docker / Compose✓ Tested
Serialize a hashtable as JSON
Produce compact JSON for a small data object.
JSON✓ Tested
Serialize nested objects with an explicit depth
PowerShell: Select a sufficient depth so nested data is retained instead of converted into a descriptive string.
PowerShell✓ Tested
Set a Compose service’s working directory
Docker / Compose: working_dir changes where the container command starts.
Docker / Compose✓ Tested
Set a container’s own hostname
Docker / Compose: hostname changes the name reported inside the container.
Docker / Compose✓ Tested