Need to complete this script to text my phone and let me know my computer is connected to the VPN. Anyone able to see any coding problems?#Variables $username_or_email = "USERNAME"; $password = "PASSWORD"; $url = "https://accounts.google.com/ServiceLogin?service=grandcentral&passive=1209600&continue=https://www.google.com/voice&followup=https://www.google.com/voice<mpl=open"; $phone = "YOURNUMBER" $send = $sending | where {$_.innerText -eq 'Send'} $text = $texts | where {$_.innerText -eq 'Text'} $ProcessActive = Get-Process dsNetworkConnect -ErrorAction SilentlyContinue if($ProcessActive -eq $null) { # Create an ie com object $ie = New-Object -com internetexplorer.application; $ie.visible = $true; $ie.navigate($url); # Wait for the page to load while ($ie.Busy -eq $true) { Start-Sleep -Milliseconds 3000; } # Add login details $ie.Document.getElementById("Email").value = $username_or_email; $ie.Document.getElementById("Passwd").value = $password; while ($ie.Busy -eq $true) { Start-Sleep -Milliseconds 5000; } # Click the button to login. $ie.Document.getElementById("signIn").Click(); # Wait for the page to load while ($ie.Busy -eq $true) { Start-Sleep -Milliseconds 5000; } # Hidden click text button -- no visual that it clicked it if you watching this run $ie.Document.getElementById("$text").Click(); # Insert phone number, message, and send it. $ie.Document.getElementById("gc-quicksms-number").value = "$phone" $ie.Document.getElementById('gc-quicksms-text2').SetAttribute('value','Connected') $ie.Document.getElementById("$send").Click(); } else { # Create an ie com object $ie = New-Object -com internetexplorer.application; $ie.visible = $true; $ie.navigate($url); # Wait for the page to load while ($ie.Busy -eq $true) { Start-Sleep -Milliseconds 3000; } # Add login details $ie.Document.getElementById("Email").value = $username_or_email; $ie.Document.getElementById("Passwd").value = $password; while ($ie.Busy -eq $true) { Start-Sleep -Milliseconds 5000; } # Click the button to login. $ie.Document.getElementById("signIn").Click(); # Wait for the page to load while ($ie.Busy -eq $true) { Start-Sleep -Milliseconds 5000; } # Hidden click text button -- no visual that it clicked it if you watching this run $ie.Document.getElementById("$text").Click(); # Insert phone number, message, and send it. $ie.Document.getElementById("gc-quicksms-number").value = "$phone" $ie.Document.getElementById('gc-quicksms-text2').SetAttribute('value','Not Connected') $ie.Document.getElementById("$send").Click(); }
↧
Powershell Script to Automate sending a text message -- Google Voice
↧