Repository navigation
Expand file tree
/
Copy pathAutoInstall.ps1
More file actions
74 lines (63 loc) · 3.06 KB
/
Copy pathAutoInstall.ps1
File metadata and controls
74 lines (63 loc) · 3.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
## ############################################################################
# 管理者権限セッションでの実行を要求する
function isInAdmin {
$UID = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
return $UID.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
}
if (-not (isInAdmin)) {
Start-Process powershell.exe -ArgumentList "-NoExit -File ""$($MyInvocation.MyCommand.Path)""" -Verb RunAs
exit 0
}
# Windows環境設定 #############################################################
# 電源設定
powercfg /list | Select-String '([0-9a-fA-F-]{36})' | ForEach-Object {
$guid = $_.Matches.Groups[1].Value
powercfg /setacvalueindex $guid SUB_VIDEO VIDEOIDLE 0
powercfg /setacvalueindex $guid SUB_SLEEP STANDBYIDLE 0
}
if ($null -eq (Get-CimInstance Win32_Battery)) {
powercfg -SETACTIVE 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
}
powercfg /S SCHEME_CURRENT
# 画面スケーリング設定
if (-not (Get-Module -ListAvailable -Name DisplayConfig)) {
Install-Module -Name DisplayConfig -Scope CurrentUser -Force -AllowClobber
}
Set-DisplayScale -DisplayId 1 -Scale 100
# ファイル拡張子表示
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Value 0
## WinGet #####################################################################
winget source update
winget upgrade --all --scope user
winget install Microsoft.WindowsTerminal
winget install Microsoft.Edit
winget install Microsoft.WindowsApp
# Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
# Find-Module -Name NetworkingDSC -Repository PSGallery | Install-Module
winget configure --file "$($PSScriptRoot)\Environment.dsc.yaml" --accept-configuration-agreements
winget configure --file "$($PSScriptRoot)\Packages.dsc.yaml" --accept-configuration-agreements
## Scoop ######################################################################
if (-not (Get-Command scoop -ErrorAction SilentlyContinue)) {
Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')
}
scoop update
scoop update *
scoop bucket add main
scoop bucket add extras
scoop install git 7zip aria2
scoop install uutils-coreutils
scoop install imagemagick ghostscript qpdf
## ファイル #######################################################################
# robocopy "Source" "Destination" /MIR /FFT /DCOPY:DAT /R:3 /W:5 /NFL /NP /XJ
# robocopy "Source" "Destination" /MIR /FFT /DCOPY:DAT /R:3 /W:5 /NFL /NP /XJ
# 追加インストール
# ## GoogleChrome
# $SetupPath = "$($env:TEMP)\chrome_installer.exe"
# Invoke-WebRequest "https://dl.google.com/chrome/install/latest/chrome_installer.exe" -OutFile $SetupPath
# Start-Process -FilePath $SetupPath -Args "/silent /install" -Wait
# Remove-Item $SetupPath
# ## Zoom
# $SetupPath = "$($env:TEMP)\zoom_installer.exe"
# Invoke-WebRequest "https://zoom.us/client/latest/ZoomInstallerFull.exe?archType=x64" -OutFile $SetupPath
# Start-Process -FilePath $SetupPath -Args "/silent /install" -Wait
# Remove-Item $SetupPath