10-of-my-most-popular-text-to-image-series-prompts-78b0897e
generate a bunch of images, then you curate the results to handpick the best ones
Chain PowerShell commands safely without &&. Use try/catch, ErrorAction, and proper sequencing for reliable Windows execution.
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
SkillHub CLI
skillhub install dalomeve/powershell-safe-chainInspect the source and compatibility requirements, then follow its installation steps.
Give your agent the source link and ask it to inspect instructions and dependencies before explaining the installation steps.
Chain commands reliably on Windows PowerShell. No && anti-patterns.
PowerShell differs from bash:
&& does NOT work for command chaining\ vs /)Wrong:
mkdir test && cd test && echo done
Right:
$ErrorActionPreference = 'Stop'
try {
New-Item -ItemType Directory -Path test -Force
Set-Location test
Write-Host 'done'
} catch {
Write-Error "Failed at step: $_"
exit 1
}
# If-then pattern
if (Test-Path $file) {
Remove-Item $file
Write-Host "Deleted"
} else {
Write-Warning "File not found"
}
# Pipeline with error handling
Get-Process | Where-Object CPU -GT 100 | Stop-Process -WhatIf
$params = @{
Path = $filePath
Encoding = 'UTF8'
Force = $true
}
Set-Content @params
| Criteria | Verification |
|---|---|
No && in scripts |
Select-String '&&' *.ps1 returns nothing |
| ErrorAction set | Select-String 'ErrorAction' *.ps1 matches |
| try/catch present | `Select-String 'try |
| Paths use Join-Path | Select-String 'Join-Path' *.ps1 matches |
[SecureString] for passwords$env:VAR
Use when:
Chain safely. Fail explicitly.
These signals come from indexed source analysis and may lag behind changes. Check the current source files.
# PowerShell Safe Chain
Chain commands reliably on Windows PowerShell. No `&&` anti-patterns.
## Problem
PowerShell differs from bash:
- `&&` does NOT work for command chaining
- Parameter parsing is case-insensitive but strict
- Errors continue by default (no fail-fast)
- Path separators vary (`\` vs `/`)
## Workflow
### 1. Safe Chaining Pattern
**Wrong**:
```powershell
mkdir test && cd test && echo done
```
**Right**:
```powershell
$ErrorActionPreference = 'Stop'
try {
New-Item -ItemType Directory -Path test -Force
Set-Location test
Write-Host 'done'
} catch {
Write-Error "Failed at step: $_"
exit 1
}
```
### 2. Conditional Chaining
```powershell
# If-then pattern
if (Test-Path $file) {
Remove-Item $file
Write-Host "Deleted"
} else {
Write-Warning "File not found"
}
# Pipeline with error handling
Get-Process | Where-Object CPU -GT 100 | Stop-Process -WhatIf
```
### 3. Splatting for Complex Commands
```powershell
$params = @{
Path = $filePath
Encoding = 'UTF8'
Force = $true
}
Set-Content @params
```
## Executable Completion Criteria
| Criteria | Verification |
|----------|-------------|
| No `&&` in scripts | `Select-String '&&' *.ps1` returns nothing |
| ErrorAction set | `Select-String 'ErrorAction' *.ps1` matches |
| try/catch present | `Select-String 'try|catch' *.ps1` matches |
| Paths use Join-Path | `Select-String 'Join-Path' *.ps1` matches |
## Privacy/Safety
- No hardcoded credentials
- Use `[SecureString]` for passwords
- Environment variables via `$env:VAR`
## Self-Use Trigger
Use when:
- Writing any PowerShell script
- Chaining 2+ commands
- Executing file operations
---
**Chain safely. Fail explicitly.**generate a bunch of images, then you curate the results to handpick the best ones
generate a bunch of images, then you curate the results to handpick the best ones
Productivity system based on Maya calendar with 13 natural tones for project management and personal development
Set up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op.