HEX
Server: Apache
System: Linux a16-asgard6.hospedagemuolhost.com.br 5.14.0-570.52.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Oct 15 06:39:08 EDT 2025 x86_64
User: maoristu4c3dbd03 (1436)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //opt/puppetlabs/puppet/bin/PowershellShim.ps1
#!/usr/bin/env powershell
#requires -version 2.0

try {
  $here = (Split-Path -Parent $MyInvocation.MyCommand.Path)
  . $here\PowershellShim-Helper.ps1

  $private:tempArgs = Get-ContentAsJson ($input -join "")

  Write-Debug "`nTask-shim deserialized arguments to Hashtable:`n"

  if ($tempArgs) {
    $tempArgs.GetEnumerator() | % {
      Write-Debug "* $($_.Key) ($($_.Value.GetType())):`n$($_.Value | ConvertTo-String)"
    }
  }

  $allowedArgs = (Get-Command $args[0]).Parameters.Keys
  $private:taskArgs = @{}
  $private:tempArgs.Keys | ? { $allowedArgs -contains $_ } | % { $private:taskArgs[$_] = $private:tempArgs[$_] }

  & $args[0] @taskArgs

} catch {
  Write-Error $_
  if ($LASTEXITCODE -eq $null) { $LASTEXITCODE = 1 }
}
exit $LASTEXITCODE