Common.ps1
function Get-BoxPath { param( [string] $Path ) $boxPath = Join-Path $global:HOME ".box" if (-not(Test-Path -Path $boxPath -PathType Container)) { New-Item -Path $boxPath -ItemType Directory | Out-Null } if ($Path) { $boxPath = Join-Path $boxPath $path } return $boxPath } function Install-Scoop { param( [Parameter(mandatory=$true)] [string] $name ) if (-Not(Get-Command "scoop")) { Write-Host "Installing scoop" Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression } } |