-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
34 lines (29 loc) · 1.11 KB
/
Justfile
File metadata and controls
34 lines (29 loc) · 1.11 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
set windows-shell := ["pwsh.exe", "-NoLogo", "-Command"]
[default]
@_:
just --list
[doc("Elevated privileges check")]
_isadmin:
#!pwsh.exe
$identify = [Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()
if (-not $identify.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Host "Recipe requires Administrator privileges" -BackgroundColor Red -ForegroundColor Black
exit 1
}
[doc("`Get-ExecutionPolicy` check")]
_isexecution:
#!pwsh.exe
$ExecutionPolicy = (Get-ExecutionPolicy).ToString()
if ($ExecutionPolicy -notin @('RemoteSigned', 'AllSigned', 'Unrestricted')) {
Write-Host "Execution policy must be 'RemoteSigned', 'AllSigned' or 'Unrestricted'"
Write-Host "Run ``Set-ExecutionPolicy AllSigned``"
exit 1
}
[doc("Run `Install-VoidLinux.ps1` bootstrap script")]
[group("DEV")]
install: _isadmin _isexecution
& .\Install-VoidLinux.ps1
[doc("Run `PSScriptAnalyzer` on `Install-VoidLinux.ps1`")]
[group("DEV")]
lint:
Invoke-ScriptAnalyzer -Path ".\Install-VoidLinux.ps1" -Settings ".\PSScriptAnalyzerSettings.psd1" -ReportSummary