Skip to content

Instantly share code, notes, and snippets.

@mikecasas
Created March 20, 2017 22:05
Show Gist options
  • Save mikecasas/7f7b186ee84824dcb1e99b9c935af299 to your computer and use it in GitHub Desktop.
Save mikecasas/7f7b186ee84824dcb1e99b9c935af299 to your computer and use it in GitHub Desktop.
cls
Set-Location($env:userprofile + '\Desktop\testbed')
$list = Import-CSV $pwd\sched.csv |
Select @{Name="room";Expression={$_."Room"}},
@{Name="start";Expression={$_."Start"}},
@{Name="end";Expression={$_."End"}},
@{Name="talk";Expression={$_."Session Assigned"}}
$lines=@()
$Rooms = New-Object string[] 10
$TimeSlots = New-Object string[] 20
$list.foreach{
$a=$_."start"
$b=$_."end"
$timeSlt="$a - $b"
$rm=$_."room"
$sess=$_."talk"
#write-output $rm
if ($TimeSlots -notcontains $timeSlt) {
$TimeSlots += $timeSlt
}
if ($Rooms -notcontains $rm) {
$Rooms += $rm
}
$body =@{
Speaker = $sess
Room = $rm
TimeSlot = $timeSlt
}
ConvertTo-Json -InputObject @($Body)
}
write-output $TimeSlots
write-output $Rooms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment