Public/Player.ps1

function Set-ASPPosition
{
    Param(
        [Parameter(Mandatory=$false, Position=0)][float]$x,
        [Parameter(Mandatory=$false, Position=1)][float]$y,
        [Parameter(Mandatory=$false)][String]$Shell
        )

        # first, get Shell we want to talk to
        $shellLocal = Get-ASDefaultShell
        if($PSBoundParameters['Shell'])
        {
            $shellLocal  = $Shell
        }
        if([System.String]::IsNullOrEmpty($shellLocal))
        {
            Write-Host 'Target shell is not set. Please specify target shell with -Shell parameter or by Set-ASDefaultShellTarget snippet.'
            return
        }

        # now, create object from all our parameters

        $object = New-Object –TypeName PSObject
        foreach ($boundParam in $PSBoundParameters.GetEnumerator())
        {
            $object | Add-Member –MemberType NoteProperty –Name $boundParam.Key –Value $boundParam.Value
        }
        
        $body = $object | ConvertTo-Json -Depth 8
        $uri = "http://$($shellLocal):4444/api/player/setposition" 
        $result = Invoke-RestMethod -Uri $uri -Body $body -Method POST -ContentType 'application/json'
        Write-Host $result
}

function Switch-ASPHook
{
  Param(
    [Parameter(Mandatory=$false)][String]$Shell
    )

    # first, get Shell we want to talk to
    $shellLocal = Get-ASDefaultShell
    if($PSBoundParameters['Shell'])
    {
        $shellLocal  = $Shell
    }
    if([System.String]::IsNullOrEmpty($shellLocal))
    {
        Write-Host 'Target shell is not set. Please specify target shell with -Shell parameter or by Set-ASDefaultShellTarget snippet.'
        return
    }  

    $uri = "http://$($shellLocal):4444/api/player/ToggleHook" 
    $result = Invoke-RestMethod -Uri $uri -Method POST
    Write-Host $result
}