Add src/remote.ps1
This commit is contained in:
16
src/remote.ps1
Normal file
16
src/remote.ps1
Normal file
@@ -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 ""
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user