PowerShell笔记

隐藏 PowerShell 欢迎页/开头标语/欢迎信息

打开 Windows Terminal 添加参数 -nologo

plaintext
"C:\Program Files\PowerShell\7\pwsh.exe" -nologo

获取历史补全文件

powershell
Get-ChildItem $env:APPDATA\Microsoft\Windows\PowerShell\PSReadLine 
bash
❯ Get-ChildItem $env:APPDATA\Microsoft\Windows\PowerShell\PSReadLine                                                                                                                                                                                Directory: C:\Users\你的用户名\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine                                    
Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a---           2024/9/13    23:45          22627 ConsoleHost_history.txt

打开C:\Users\你的用户名\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt

删除你不想要的历史记录。