I have some ps code, that downloads xml via http and check some xml in it
[xml]$stuff = $wc.DownloadString('url')
$xmlvalue = $stuff.SelectSingleNode('xpath')
if ($xmlvalue.'#text' -eq "value")
{
$state = 'OK'
Write-Host 'ok'
}
All i need is an ability to run that script as
script.ps1 -url -xpath -operator -value
It`s no problem at all, except -operator
I can`t use param like -operator "-eq", because it will be an error
Any way to do it ?
You can generate scriptblock on the fly: