通过powershell中的变量更新链接

问题描述 投票:-3回答:1

我正在尝试构建一个脚本,它将从网站上获取一些文本并将其放入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
}
powershell scripting
1个回答
0
投票

我最终使用纯文本,它工作得很好。但是如果有人能告诉我为什么我从csv文件中获取这个http://@{variable=xyz}.com输出,我会感激不尽

© www.soinside.com 2019 - 2024. All rights reserved.