everyone, i am just starting out with learning powershell and right now i just started practicing with some scripts, and i thought my first script should be one, that lets me open a browser, click the login, fill in the information, log me in, and sign me in at my workplace.
This is the code i've written so far:
$ie = New-Object -com InternetExplorer.Application #åbner internet explorer
$ie.visible=$true #gør den synlig
$ie.navigate('https://itd-skp.sde.dk/')
while ($ie.Busy -eq $true){Start-Sleep -seconds 4;}
$link = $ie.Document.getElementsByTagname('A') | Where-Object {$_.innerText -eq 'Log ind'}
$link.click()
This is all of the code of the website, which i have access to, so i hope this is enough.
I suck at both coding and powershell, since i am fairly new with this (this is basically my second day) so if i can get the dumbed down versions, that would be nice.
My question is now, how do i add value to the function $link, in this case, or how do i get it to click that button on the bottom?


Continuing from my comment...
Some sites just don't allow or inhibit automation and then there are sites that what you see is not what really is. You have to dig at it. For Example the URL you show, has a lot of classes and Divs, frames. So, if what you are after is embedded in those, then more code is required.
You also need to dig at how to scrape a site to see the objects that can be worked with.
A simple scrape shows this...
Load and Use the info on the site
Step through the elements to find which has a click method
Note there are multiple 'A' in the returned array, which are zero-based, but you only want the second on in this case, but that is really at index 1, not 2.
Yet, notice how the text for 'Log ind' renders.
It's got spaces. So, '-eq' without including the space will fail to find it.
As noted referencing the correct object grants access to the click method. Yet as shown they come back as below...
So,all-in-all one, for this site could just to this.
This just gets you pass your main login page (per you post query). Dealing with the new page is a new effort.
Again, spend the needed time getting up to speed on PowerShell via the pointers I call out in my original comment.