Explain PowerShell code
Paste a PowerShell script and Vibe explains what each cmdlet in the pipeline passes along, what $_ holds and what -WhatIf would change before anything runs.
Up to 1,500 characters (about 60 lines). Your code is sent to Unvibe and Anthropic to write the explanation. Don't paste keys or passwords. Common key formats are refused.
Vibe23 lines selected
Press Explain it for the sample, or paste your own code first.
What this PowerShell sample shows
- cmdlets and the pipeline
Get-ChildItemlists the files,|hands each one toWhere-Object, which keeps the ones that pass its test, andSort-Object Length -Descendingputs the biggest first.-Filter *.logand-Filenarrow the list before anything reaches the pipeline, sonotes.txtand the folders never show up.- objects and properties
- The pipeline passes file objects, not lines of text. Inside
{ ... },$_is the current file, so$_.LastWriteTimeand$_.Lengthare its date and size, with no text to cut apart.@{ Name = "SizeKB"; Expression = { ... } }adds a column worked out for each file, and1KBis PowerShell's own constant for 1,024. - parameters
param()declares what the script takes.[Parameter(Mandatory)]made a run with no-Pathstop withmissing mandatory parameters: Path,[int]made-Days abcstop withCannot convert value "abc" to type "System.Int32", and= 30is the default when-Daysis left out.- WhatIf and ShouldProcess
[CmdletBinding(SupportsShouldProcess)]gives the script a-WhatIfswitch.$PSCmdlet.ShouldProcess(...)returns false under-WhatIfand prints the change instead, so the run printedWhat if: Performing the operation "Delete" on target ...for each old log and deleted nothing.
Good to know
- Run with PowerShell 7.6.9 on four test files, two .log files from 20 September, one from 4 November and a .txt, with
-Days 30 -WhatIfon 5 November: it listed the two September logs, printed2 files, 250.0 KBand left all four files in place. - The same run without
-WhatIf, on a copy of the folder, deleted exactly those two logs and keptnotes.txtand the November log. - With one old file the summary read
1 files, 2.0 KB, and with none0 files, 0.0 KB..Countworks on a single result and on an empty one in PowerShell 7, so the line never breaks.
Watch out: Use -LiteralPath for file names you didn't type. In a file called app[1].log, -Path reads [1] as a wildcard: Remove-Item -Path matched nothing, deleted nothing and still reported success, while -LiteralPath removed the file.
Explain PowerShell code beside your editor
Unvibe is a free app for Mac and Windows. In the app there is no pasting: select code in any app and press Control+U (Ctrl+Alt+U on Windows).
Install on Mac
curl -fsSL https://unvibe.site/install.sh | bashPaste into Terminal. Unvibe isn't notarized by Apple yet, so this is the smooth path.
Or download the .dmg · Intel Mac build · SHA-256 checksums
Opening the .dmg the first time
- Open the .dmg and drag Unvibe to Applications.
- Open it once; macOS says it can't verify it. Click Done.

Real screen, macOS 15 - System Settings › Privacy & Security › Open Anyway. Confirm, then enter your Mac password. The button shows for about an hour after you try to open Unvibe.

Real screen, macOS 15
The Terminal line checks the download against the published SHA-256 and Unvibe's self-signed signature before it installs anything. More help with the first open