Reputation: 93
Hi everybody,
My goal is that i can run a Powershell script which then creates a shortcut of the Website which is opened at the moment. I know it's no problem to create a shortcut from a path or document, but now i habe to do it from a website. First of all, is that even possible? If yes, do i need a add on or does it just work with Powershell?
I haven't found anything usefull in the internet. I'm not really skilled with Powershell so that's why i'm not sure if that is even possible.
I'm thankful at any hint.
Greetings.
Upvotes: 0
Views: 273
Reputation: 477
Yehellow
I don't know how to do it in powershell, but there is another programming language called AutoIt. It's made for automations exactly like this. Just download it from the AutoIt page.
Here is the code that worked for me. If you need to inport it into your powershell script just compile the AutoIt code into an .exe, run it with powershell and read the output from a .txt file.
Syntax:
#include <IE.au3>
$oIE = _IEAttach("*TITLE OF THE PAGE*")
$url = _IEPropertyGet($oIE, "locationurl")
Example:
#include <IE.au3>
#include <MsgBoxConstants.au3>
$oIE = _IEAttach("Google")
$url = _IEPropertyGet($oIE, "locationurl")
MsgBox(0,$url,$url)
As far as i know it only works for IE. Sorry for not having a solutoin for Powershell.
Upvotes: 1