Link to home
Start Free TrialLog in
Avatar of rdkli
rdkliFlag for Liechtenstein

asked on

On click on http link run Powershell Script - How to get the link as variable

Hi Folks

Currently when we click a hyperlink, it runs a VBS Script to determine if the link is internal (normally run Browser) or external (run IE from rdp-connection).
Now I need to upgrade the script to powershell.
My Current problem is: When I click on a Link to run a ps-script, how do I reach the clicked link to determine if it's internal or external?
In vbs it would be Wscript.Arguments(0)  to work with. But what is it in Powershell? Has anyone a clue?

Best Wishes
ASKER CERTIFIED SOLUTION
Avatar of Chris Dent
Chris Dent
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rdkli

ASKER

Hi!

yep, args is the solution.

Well - we edited some registry entries in HKEY_Classes_Root for ftp, http and https. Under http\shell\open\command you can enter a script which should run.
Currently I have the value : <C:\windows\system32\windowspowershell\version\powershell exe" -file "Filepath" %1>  (without <> ofc :-) ) in there.

In the powershell script i can use args[0] to handle the Link.

Thanks for coming up with the args :-)