mo.khorami
mo.khorami

Reputation: 79

Check exe version and download new version

I have a PowerShell script which opens Internet Explorer, then finds a website and clicks on the site to open it:

$IE = new-object -com internetexplorer.application
$IE.navigate("https://www.google.com/search?ei=j-KLWrGyI5G2gQbN9KOQAg&q=%D8%AF%D8%A7%D9%86%D9%84%D9%88%D8%AF+%D9%85%D9%88%D8%B2%DB%8C%DA%A9&oq=%D8%AF%D8%A7%D9%86%D9%84%D9%88%D8%AF+%D9%85%D9%88%D8%B2%DB%8C%DA%A9&gs_l=psy-ab.3..0l10.509762.515959.0.516306.23.19.1.0.0.0.358.2")
$IE.visible=$true
while($ie.busy) {sleep 5} 

$Link = $IE.Document.getElementsByTagName("span") | ? {$_.InnerHTML -eq "دانلود آهنگ جدید | دانلود موزیک"}

$Link.click()

Can I check the version in this script of my website version and update by Update-ModuleManifest to automatically download a new script from my web site to replace this script?

Upvotes: 1

Views: 133

Answers (1)

Jason Shave
Jason Shave

Reputation: 2672

It's difficult to understand what you're trying to do. You're talking about updating a module manifest yet you've asked to check a version of a script.

What I can suggest is that you post your script to powershellgallery.com and use Update-Module (if it's a module) or Update-Script (if it's a script). I've done this to maintain scripts/modules I've written and it works well.

Where is your logic for checking the website version? I'm assuming if you had a tag in the website you could pull this element. Maybe post the full code in English too.

Upvotes: 1

Related Questions