-
Notifications
You must be signed in to change notification settings - Fork 12
/
MERC_FW_LOAD.ps1
38 lines (30 loc) · 1.32 KB
/
MERC_FW_LOAD.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<#
1. Put the zip firmware file in the same file as this NVX_FW_LOAD.ps1
2. Make sure you run auto discovery first and all the device you want to update are there
3. Run this and check back in 30 minutes
#>
# minimum required version
#Requires -Version 4
Set-StrictMode -Version Latest
# import the module
Import-Module PSCrestron
# auto discover the devices in the subnet
Write-Host 'Running Auto-Discovery...'
$devs = Get-AutoDiscovery |
Where-Object Description -Match 'MERCURY' |
Select-Object -ExpandProperty IP |
Get-VersionInfo -Secure -Username admin -Password admin |
Where-Object MACAddress -Match '[A-F\d\.]+' | Where-Object VersionPUF -NotMatch "1.3705.00093.001"
# firmware file
# $fw = Get-ChildItem -Path $PSScriptRoot -Filter *.zip
# $fw = "C:\Users\p_sanderson\Downloads\dm-nvx-350_dm-nvx-350c_dm-nvx-351_dm-nvx-351c_1.3707.00028.zip"
# start the jobs
write-host 'starting script block'
$fw = "C:\Users\p_sanderson\Downloads\mercury_1.3705.00093.001.puf"
$devs | Invoke-RunspaceJob -SharedVariables fw -ScriptBlock {
write-host 'in script block sending fw'
# need to check if its $_ or $_.IPAddress that worked.
Send-CrestronFirmware -Device $_.IPAddress -LocalFile $fw -ImageUpdate -Password admin -Secure -Username admin
}
Write-Host 'Done.'
Read-Host -Prompt “Press Enter to exit”