Fix URI parsing
Tested only for sftp. Without the leading ..// the System.Uri will fail on the next line, as the string is empty.
This commit is contained in:
+2
-2
@@ -244,7 +244,7 @@ function Invoke-ConnectivityCheck {
|
|||||||
else {
|
else {
|
||||||
# parse connection string for hostname
|
# parse connection string for hostname
|
||||||
# Uri parser doesn't handle leading connection type info (s3:, sftp:, rest:)
|
# Uri parser doesn't handle leading connection type info (s3:, sftp:, rest:)
|
||||||
$connection_string = $env:RESTIC_REPOSITORY -replace "^s3:" -replace "^sftp:" -replace "^rest:"
|
$connection_string = $env:RESTIC_REPOSITORY -replace "^s3:","s3://" -replace "^sftp:","sftp://" -replace "^rest:","rest://"
|
||||||
$repository_host = ([System.Uri]$connection_string).host
|
$repository_host = ([System.Uri]$connection_string).host
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -364,4 +364,4 @@ function Invoke-Main {
|
|||||||
exit $error_count
|
exit $error_count
|
||||||
}
|
}
|
||||||
|
|
||||||
Invoke-Main
|
Invoke-Main
|
||||||
|
|||||||
Reference in New Issue
Block a user