14 lines
594 B
PowerShell
14 lines
594 B
PowerShell
Describe 'Bootstrap invocation' {
|
|
It 'rejects in-memory execution because elevation requires a script file' {
|
|
$source = Get-Content "$PSScriptRoot/../bootstrap.ps1" -Raw
|
|
$bootstrap = [scriptblock]::Create($source)
|
|
$previousLocalAppData = $env:LOCALAPPDATA
|
|
try {
|
|
$env:LOCALAPPDATA = $TestDrive
|
|
{ & $bootstrap -Repository 'https://example.invalid/config-central.git' -Machine test } |
|
|
Should -Throw '*must be downloaded and run as a file*'
|
|
}
|
|
finally { $env:LOCALAPPDATA = $previousLocalAppData }
|
|
}
|
|
}
|