Powershell Script to Let You Know GDR2 Amber is out for Lumia 920 on AT&T

anon(5803215)

New member
Mar 17, 2013
27
0
0
Visit site
This being a WP forum there must be some Windows PowerShell geeks here as well. Below is a PowerShell script I made to let you know when GDR2 for Nokia Lumia 920 on AT&T is out. Run this script as a scheduled task for best results.

Code:
If ((Get-Command -Name * | Where-Object {$_.Name -eq "Invoke-WebRequest"}) -ne $Null)
	{
		While ($True -eq $True)
			{
				[String] $URI = "http://www.nokia.com/global/support/software-update/wp8-software-update/availability-in-north-america/"
				[String] $Status = '<tr><td rowspan="1" colspan="1" data-title="Product">Lumia 920</td><td rowspan="1" colspan="1" data-title="Description">AT&T</td><td rowspan="1" colspan="1" data-title="Latest version">1232.5962.1314.0001</td><td rowspan="1" colspan="1" data-title="Lumia Amber update">Waiting for approval</td></tr>'
				$HTML = Invoke-WebRequest -URI $URI
				[Bool] $HTML = Select-String -InputObject $HTML.RawContent -Pattern $Status
				If ($HTML -eq $False)
					{
						[Int] $Int = 0
						While($Int -le 5)
							{
								[System.Media.SystemSounds]::Beep.Play()
								Start-Sleep -Seconds 1
								[System.Media.SystemSounds]::Hand.Play()
								Start-Sleep -Seconds 1
								$Int++
							}
						[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
						[System.Windows.Forms.MessageBox]::Show("GDR2 (Amder) may be out!" , "GDR2")
					}
				Else
					{
						Start-Sleep -Seconds 900 #15 Minutes
					}
			}
	}
Else
	{
		Write-Host "Powershell 3 or Higher Requested"
	}
 

mase123987

New member
Mar 1, 2012
3,118
0
0
Visit site
LOL ... People really want their update! I don't know much about this so if it works, good job! That said, could you just set that site as a live tile on your phone and check it once a day? Or be lazy like me and just wait for my phone to tell me.
 

anon(5803215)

New member
Mar 17, 2013
27
0
0
Visit site
Version 2 now with AT&T website checking as well.

Code:
#Requires -Version 3.0
[String] $NokiaURI = "http://www.nokia.com/global/support/software-update/wp8-software-update/availability-in-north-america/"
[String] $NokiaStatus = '<tr><td rowspan="1" colspan="1" data-title="Product">Lumia 920</td><td rowspan="1" colspan="1" data-title="Description">AT&T</td><td rowspan="1" colspan="1" data-title="Latest version">1232.5962.1314.0001</td><td rowspan="1" colspan="1" data-title="Lumia Amber update">Waiting for approval</td></tr>'
[String] $ATTURI = "http://www.att.com/esupport/softwareUpdateArticle.jsp?sid=KB419633&cv=820&_requestid=90953#fbid=1RD0MIz5VW1"
[String] $ATTStatus = "<STRONG>1232.5962.1314.0001</STRONG>"
Function Get-GDR2OutMessage
	{
		[Int] $Int = 0
		While($Int -le 5)
			{gs	
				[System.Media.SystemSounds]::Beep.Play()
				Start-Sleep -Seconds 1
				[System.Media.SystemSounds]::Hand.Play()
				Start-Sleep -Seconds 1
				$Int++
			}
		[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
		[System.Windows.Forms.MessageBox]::Show("GDR2 (Amber) may be out!" , "GDR2")
		Exit
	}
Function Get-GDR2Request ([String] $URI, [String] $Status)
	{
		$HTML = Invoke-WebRequest -URI $URI
		Return [Bool] (Select-String -InputObject $HTML.RawContent -Pattern $Status)
	}
While ($True -eq $True)
	{
		$Nokia = Get-GDR2Request -URI $NokiaURI -Status $NokiaStatus
		$ATT = Get-GDR2Request -URI $ATTURI -Status $ATTStatus
		If (($Nokia -eq $False) -or ($ATT -eq $False))
			{
				Get-GDR2OutMessage
			}
		Else
			{
				Start-Sleep -Seconds 900 #15 Minutes
			}
	}
 

Members online

Forum statistics

Threads
326,862
Messages
2,248,989
Members
428,547
Latest member
WhiteWolf