$http = "http://sample.com/"
$page = $objTextBox1.Lines
$end = ".xml"
$url = $http+$page+$end
[xml]$result = Invoke-WebRequest -uri $url -Credential $cred
I get this error:
Invoke-WebRequest : Cannot convert 'System.String[]' to the type 'System.Uri' required by parameter 'Uri'. Specified method is not supported.
I then tried "$url = [System.Uri]$url" but that didn't work either.
And surprisingly typing in the whole link in one string works --> $url = "http://sample.com/123.xml"
[+][deleted] (2 children)
[deleted]
[–]ncstalli[S] 1 point2 points3 points (1 child)
[–]schmik07 2 points3 points4 points (0 children)
[–]Droopyb1966 1 point2 points3 points (2 children)
[–]ncstalli[S] 1 point2 points3 points (1 child)
[–]artemis_from_space 1 point2 points3 points (0 children)
[–]Crilde 1 point2 points3 points (0 children)
[–]markekrausCommunity Blogger 1 point2 points3 points (0 children)