Debian Codegraph @

test/lib/ansible_test/_util/target/setup/entrypoint.ps1

raw
1 & {
2 $ErrorActionPreference = 'Stop'
3
4 $codeJson = [Text.Encoding]::UTF8.GetString([Convert]::FromBase64String('{{ MANIFEST }}'))
5 $code = $codeJson | ConvertFrom-Json
6 $splat = @{}
7
8 foreach ($obj in $code.params.PSObject.Properties) {
9 $splat[$obj.Name] = $obj.Value
10 }
11
12 $errors = @()
13 $ast = [System.Management.Automation.Language.Parser]::ParseInput($code.script, $code.path, [ref]$null, [ref]$errors)
14
15 if ($errors) {
16 throw "Failed to parse PowerShell script: $errors"
17 }
18
19 $cmd = $ast.GetScriptBlock()
20
21 & $cmd @splat
22 }