我正在尝试构建一个脚本,它将从网站上获取一些文本并将其放入excel表中,但我在使用URL中的变量时遇到问题,当使用变量时我的输出是http://@{variable=xyz}.com
,我是试图只获得xyz
,任何帮助将不胜感激
我的代码:
$ip = get-content c:\..
foreach ($ip in $ipadd){
$url = http://$ip/mywebsite.com
$html = invoke-webrequest -uri $url
$elements = $html.Allelements | where class -eq "class" | select -expandproperty innertext
}
我最终使用纯文本,它工作得很好。但是如果有人能告诉我为什么我从csv文件中获取这个http://@{variable=xyz}.com
输出,我会感激不尽