Skip to content

Instantly share code, notes, and snippets.

@kiennq
Created September 10, 2022 13:18
Show Gist options
  • Save kiennq/ed235d57d9637f179562dc7d3fc3cf86 to your computer and use it in GitHub Desktop.
Save kiennq/ed235d57d9637f179562dc7d3fc3cf86 to your computer and use it in GitHub Desktop.
Windows Env Setup template
# install scoop for other packages
# Need to use job since scoop installer can just {exit 1}
Start-Job -ScriptBlock {
Invoke-WebRequest -useb 'get.scoop.sh' | Invoke-Expression -ErrorAction SilentlyContinue
} | Wait-Job | Receive-Job
if (!(Get-Command 'git' -ErrorAction SilentlyContinue))
{
scoop install git
}
scoop bucket add extras
scoop bucket add misc https://github.com/kiennq/scoop-misc
# boostrap all the dotfiles
Push-Location ~
mkdir .ssh
[System.Text.Encoding]::UTF8.GetString(
(Invoke-WebRequest -useb `
-Headers @{Authorization = "<YOUR GITHUB DOTFILES REPO TOKEN>"; `
Accept = "application/vnd.github.v3.raw"} `
'https://api.github.com/repos/<your>/dotfiles/contents/.ssh/id_rsa').Content) `
| Out-File .ssh/id_rsa -Force
git init .
git remote add origin git@github.com:<your>/dotfiles.git
git fetch origin master
git reset --hard origin/master
git branch -u origin/master
Pop-Location
scoop update
scoop reset git
# install additional packages
scoop install aria2 gsudo-x
scoop install ripgrep pwsh-x 7zip zstd screentogif fzf winrar
scoop install emacs-k diffutils
gsudo cache on
# These packages change $env:PATH
gsudo scoop install cascadiacode-pl -g
gsudo -k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment