Merge branch 'windows' of github.com:qwjyh/dotfiles into windows

This commit is contained in:
qwjyh 2022-09-29 04:21:11 +09:00
commit bd055f6240
6 changed files with 292 additions and 14 deletions

View file

@ -1,23 +1,15 @@
#!/usr/bin/pwsh
# dotfiles install script for Windows
# Execute
# Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
# first to run pwsh scripts
# check administration role
$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
$bool_admin = $currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
if (!$bool_admin) {
Write-Warning -Message "require Admin privilage
please run as Administrator"
exit 1
}
#Requires -RunAsAdministrator
# check pwsh version
# ≧ 7
if ($PSVersionTable.PSVersion.Major -lt 7) {
Write-Warning -Message "pwsh version must be greater than 7
please install powershell 7 (Core)
you can install via winget"
exit 1
}
#Requires -Version 7
# check working directory
if (!(
@ -35,6 +27,17 @@ Write-Output "Pscx"
Install-Module -Name Pscx -AllowPrerelease
Write-Output "z"
Install-Module -Name z
Install-Module -Name PSFzf -RequiredVersion 2.5.10
# install scoop
if(!(Get-Command scoop -ErrorAction SilentlyContinue)) {
Write-Output "Installing scoop..."
irm get.scoop.sh | iex
}
# install basic scoop apps
# import from exported json file
# to update the json file, execute ./bin/scoop_apps/update_scoop_list.ps1
scoop import .\bin\scoop_apps\scoop_minimal_apps.json
# make symbolic links