使用[uri]::EscapeDataString($element)
可以转义每一个特殊字符,包括/
,但我仍然需要url可读的报告a11ym生成。我如何才能在PowerShell中跳过&
?只对特定字符进行编码[PowerShell]
# Execute a11y machine
$urls = @(
"https://url.com/"
"https://url.com/jobs/intro?_ab_sessid=6f022ebc900f9cd04a6383f8eaab3c64",
"https://url.com/jobs/intro?_ab_sessid=6f022ebc900f9cd04a6383f8eaab3c64&mobile=false&width=675&height=500&bga=true&needsRedirect=false&jan1offset=-300&jun1offset=-240&in_iframe=1",
"https://url.com/jobs/search?ss=1&searchLocation=&searchCategory=&hashed=-435830103"
)
$encode = foreach ($element in $urls) {
[uri]::EscapeDataString($element)
}
a11ym -o careers_reports/$(Get-Date -UFormat "%Y-%m-%d")/ $encode
a11ym-dashboard --root careers_reports --static-output
的转义字符是' 所以 Hey'&你好 – ArcSet