Have a tool that convert code from powershell to php/python?

this origin code:

#Requires -Version 5.1 -Modules @{ModuleName="PSFalcon";ModuleVersion='2.1'}
param(
    [Parameter(Mandatory = $true, Position = 1)]
    [ValidatePattern('\.txt$')]
    [ValidateScript({
        if (Test-Path -Path $_ -PathType Leaf) {
            $true
        } else {
            throw "Cannot find path '$_' because it does not exist or is a directory."
        }
    })]
    [string] $Path,
    Start-Sleep
     -Milliseconds 30000
    [Parameter(Mandatory = $true, Position = 2)]
    [string] $Name,
    Start-Sleep
     -Milliseconds 15000
    [Parameter(Position = 3)]
    [string] $Description
)
process {
    try {
        # Import hostnames and create host group
        $Hostnames = (Get-Content -Path $PSBoundParameters.Path).Normalize()
        $Param = @{
            GroupType = 'static'
            Name      = $PSBoundParameters.Name
        }
        if ($PSBoundParameters.Description) {
            $Param['Description'] = $PSBoundParameters.Description
        }
        $Group = New-FalconHostGroup @Param
        [array] $HostIds = for ($i = 0; $i -lt $Hostnames.count; $i += 20) {
            # Retrieve the device_id for hostnames in groups of 20
            $Filter = ($Hostnames[$i..($i + 19)] | ForEach-Object {
                if ($_ -ne '') {
                    "hostname:['$_']"
                }
            }) -join ','
            ,(Get-FalconHost -Filter $Filter)
        }
        # Add hosts to group
        Invoke-FalconHostGroupAction -Name add-hosts -Id $Group.id -HostIds $HostIds
    } catch {
        throw $_
    }
}

I glad for any hel[p
nate

Nsh531,
Welcome to the forum. :wave:t4:

I assume you already searched for it online, didn’t you?

I’d expect it to be pretty unlikely to have a tool what’s automatically and reliably converts PowerShell code to PHP or Python. Especially when you even use an external module in PowerShell.

I’d consider these languages to be intended for different environments and use cases.

Regardless of that - when you want to migrate to a different language I’d recommend to ask for in a forum for the target language and to verbosly and detailed describe what the code actually does. It might not be likely for a lot of developers to know both languages well enough. :wink: