WindowsPowerShell/install.ps1

27 lines
877 B
PowerShell

if (Get-Command scoop.ps1 -ErrorAction SilentlyContinue) {
$ScoopCompletion = "$($(Get-Item $(Get-Command scoop.ps1).Path).Directory.Parent.FullName)\modules\scoop-completion"
if (!(Test-Path $ScoopCompletion)) {
scoop bucket add extras
scoop install scoop-completion
}
}
if (!(Test-Path -PathType Container $env:LOCALAPPDATA\layouts)) {
New-Item -ItemType Directory -Path $env:LOCALAPPDATA\layouts
Write-Output "changed: created directory $env:LOCALAPPDATA\layouts"
}
$layouts = (
'window-wide-right.ps1',
'window-wide-left.ps1'
)
foreach ($layout in $layouts) {
$source = "$env:USERPROFILE\Documents\WindowsPowerShell\layouts\$layout"
$dest = "$env:LOCALAPPDATA\layouts\$layout"
if (!(Test-Path -PathType Leaf $dest)) {
New-Item -ItemType SymbolicLink -Path "$dest" -Target "$source"
Write-Output "changed: created symlink $dest"
}
}