Buffer v. disk - a visceral lesson.

TL;DR: Turns out, “unsaved” really means “nonexistent” — I chased a phantom file for 10 minutes.
I created and opened in VS Code a .ps1 file from the terminal.
PS C:\Users\EliKent\Documents\WindowsPowerShell> code sandbox.ps1
But I didn’t actually save it — I just started typing. So the file only lived in memory. And I spent the next 10 minutes chasing a ghost.
-
I listed the contents of the current working directory:
PS C:\Users\EliKent\Documents\WindowsPowerShell> ls Directory: C:\Users\EliKent\Documents\WindowsPowerShell Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 2/24/2022 1:13 PM Modules d----- 2/24/2022 1:05 PM Scripts -a---- 7/31/2025 4:47 PM 4775 Microsoft.PowerShell_profile.ps1
Not there.
-
Next I listed hidden files with -Force:
PS C:\Users\EliKent\Documents\WindowsPowerShell> ls -Force Directory: C:\Users\EliKent\Documents\WindowsPowerShell Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 2/24/2022 1:13 PM Modules d----- 2/24/2022 1:05 PM Scripts -a---- 7/31/2025 4:47 PM 4775 Microsoft.PowerShell_profile.ps1
Still not there.
-
Then I searched for the file:
PS C:\Users\EliKent\Documents\WindowsPowerShell> Get-ChildItem -Filter "sandbox.ps1" -Recurse -ErrorAction SilentlyContinue -Force PS C:\Users\EliKent\Documents\WindowsPowerShell>
Nada. Zip. Zero.
-
And finally, I tried setting the file's property as
Hidden = False
:PS C:\Users\EliKent\Documents\WindowsPowerShell> Set-ItemProperty -Path .\sandbox.ps1 -Name IsHidden -Value $false Set-ItemProperty : Cannot find path 'C:\Users\EliKent\Documents\WindowsPowerShell\sandbox.ps1' because it does not exist. At line:1 char:1 + Set-ItemProperty -Path .\sandbox.ps1 -Name IsHidden -Value $false
Still nothing. That file did not exist.
-
Finally, Google Code Assist suggested I save the
.ps1
file:Save Ctrl+SSuccess!
Lesson: Until you save, you're living in RAM.
- PowerShell
- VS Code
- Google Code Assist
Tools Used: