17 lines
395 B
PowerShell
17 lines
395 B
PowerShell
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 ""
|
|
}
|
|
}
|