Skip to content

Instantly share code, notes, and snippets.

@pengx17
Created September 11, 2024 10:43
Show Gist options
  • Save pengx17/df6e09d09865faaebcc389accdf2b26d to your computer and use it in GitHub Desktop.
Save pengx17/df6e09d09865faaebcc389accdf2b26d to your computer and use it in GitHub Desktop.
Windows development
- Upgrade powershell
- https://learn.microsoft.com/zh-cn/powershell/scripting/whats-new/migrating-from-windows-powershell-51-to-powershell-7?view=powershell-7.3
- https://github.com/PowerShell/PowerShell/releases/download/v7.3.6/PowerShell-7.3.6-win-x64.msi
- Also add the shell to Terminal
- chocolatey
- cmd
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
- powershell
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
- startship
- https://zhuanlan.zhihu.com/p/144611023
- fzf https://gist.github.com/CIPop/ff623f861600c1e864c245910c5ec2c8
- choco install fzf
- Need to enable symlink
- git config core.symlinks true
- git reset --hard HEAD
[图片]
- My $profile
Invoke-Expression (&starship init powershell)
Import-Module PSReadLine
Set-PSReadlineKeyHandler -Key Tab -Function Complete
Set-PSReadLineKeyHandler -Key "Ctrl+d" -Function MenuComplete
Set-PSReadLineKeyHandler -Key "Ctrl+z" -Function Undo
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
# 重要!不要过滤掉敏感命令
Set-PSReadLineOption -AddToHistoryHandler $null
Import-Module PSFzf
Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+t' -PSReadlineChordReverseHistory 'Ctrl+r'
# Import the Chocolatey Profile that contains the necessary code to enable
# tab-completions to function for `choco`.
# Be aware that if you are missing these lines from your profile, tab completion
# for `choco` will not function.
# See https://ch0.co/tab-completion for details.
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
Import-Module "$ChocolateyProfile"
}
#34de4b3d-13a8-4540-b76d-b9e8d3851756 PowerToys CommandNotFound module
Node
- https://nodejs.org/en/download
Rust
- https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe
VSCode
utools
Github desktop
Useful commands
- Specifying env
- $env:SKIP_GENERATE_ASSETS = 'true'
- $env:BUILD_TYPE = "canary"
- refreshenv to refresh env or
- Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
- Print env: gci env:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment