<#

This script retrieves the room number from a PC assuming format: ABC101SYS002,

then calls the Insight installer passing along the room as the Channel name.

It adjusts for campuses ABC and XYZ, prepending a 2/3 (ABC116 = channel 2116).

It also removes the leading zero in a room (ABC019 = channel 19).

#>

$PC = $env :computername

$Bldg = $PC .Substring ( 0 , 3 ) #parse from 1st character for 3 characters

$Room = $PC .Substring ( 3 , 3 ) #parse from 4th character for 3 characters

If ( $Bldg -eq "abc" ) { $Bldg = "2" } #Evaluate Building for campuses, assign code value

ElseIf ( $Bldg -eq "xyz" ) { $Bldg = "3" }

Else { $Bldg = "" }

if ( $Room .Substring ( 0 , 1 ) -eq "0" ) { $Room = $Room .Substring ( 1 , 2 ) } #remove leading zero

$Chan = $Bldg += $Room #creates channel number, prepending Building code