Sample code for 30+ languages & platforms
PowerShell

Load XML from a Remote URL

Demonstrates how to load XML from a remote URL, such as https://www.chilkatsoft.com/hamlet.xml

Chilkat PowerShell Downloads

PowerShell
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"

$success = $false

# This example assumes the Chilkat HTTP API to have been previously unlocked.
# See Global Unlock Sample for sample code.

$http = New-Object Chilkat.Http
$sbXml = New-Object Chilkat.StringBuilder

# Download the XML from the URL into sbXml
$success = $http.QuickGetSb("https://www.chilkatsoft.com/hamlet.xml",$sbXml)
if ($success -eq $false) {
    $($http.LastErrorText)
    exit
}

$xml = New-Object Chilkat.Xml

# Load the XML contained in sbXml
$success = $xml.LoadSb($sbXml,$true)
if ($success -eq $false) {
    $($xml.LastErrorText)
    exit
}

$("Success.")