diff --git a/src/remote.ps1 b/src/remote.ps1 new file mode 100644 index 0000000..8315cae --- /dev/null +++ b/src/remote.ps1 @@ -0,0 +1,16 @@ +function Get-RemoteText { + [CmdletBinding()] + param( + [Parameter(Mandatory = $true)] + [string]$Url + ) + + try { + $resp = Invoke-WebRequest -Uri $Url -UseBasicParsing -ErrorAction Stop + return $resp.Content + } + catch { + Write-LogHybrid "Get-RemoteText failed for ${Url}: $($_.Exception.Message)" Warning UI -LogToEvent + return "" + } +}