diff --git a/scripts/utils.ps1 b/scripts/utils.ps1 index 2835ac9..714c983 100644 --- a/scripts/utils.ps1 +++ b/scripts/utils.ps1 @@ -1,3 +1,11 @@ +function Ensure-Exists ($path) { + if (-not (Test-Path $path)) { + Write-Error "Missing required $path! Ensure it is installed" + exit 1 + } + return $true > $null +} + function Ensure-Executable ($command) { try { Get-Command $command -ErrorAction Stop > $null } catch { @@ -47,4 +55,4 @@ function Flatten-Directory ($name) { function Digest-MD5 ($path) { return Invoke-Expression "md5sum $path" -} \ No newline at end of file +}