[CmdletBinding()]
param(
    [Parameter(Mandatory)][string]$AbsoluteUrl
)

$uri = [System.Uri]$AbsoluteUrl

Write-Host "Converting URL '$uri' to elixForms WS call format..."

Import-Module $(Join-Path (Split-Path -Parent $MyInvocation.MyCommand.Definition) "extract-elx-module.psm1") -Force

$convertedUrl = Convert-UrlToElixAutocompleteFormat -AbsoluteUrl $uri

Write-Host "Converted URL:" -ForegroundColor Cyan
Write-Host "$convertedUrl" -ForegroundColor Cyan

Write-Host "URL converted successfully!" -ForegroundColor Green
