Skip to content

Instantly share code, notes, and snippets.

@bakamake
bakamake / profile for pwsh
Last active October 21, 2025 06:22
profile for pwsh 7.xx
#消除一个微软的pwsh启动bug,使在开始菜单启动pwsh时会进入home作为工作目录
if(($PWD).Path -eq "C:\Program Files\WindowsApps\Microsoft.PowerShell_7.5.3.0_x64__8wekyb3d8bbwe" -or
($PWD).Path -eq "C:\Windows\SystemApps\MicrosoftWindows.Client.CBS_cw5n1h2txyewy" ){
Set-Location $HOME
}
#挂载WSL virtual network drive file system to PSdrive
#这样做可以使用命令ls wsl:
if($null -eq (get-psdrive wsl -ErrorAction SilentlyContinue).name){new-psdrive -Name "WSL" -PSProvider FileSystem -Root "\\WSL$\Debian"}
#环境设置
#scoop 方便安装scoop,也可以设置在其他位置比如 C:\users\bakam\onedrive\scoop