-
Notifications
You must be signed in to change notification settings - Fork 0
/
Meeting-Host.ps1
38 lines (31 loc) · 1.11 KB
/
Meeting-Host.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
function Get-MeetingPeople {
param (
[Parameter(Mandatory=$false)] $Speaker = "",
[Parameter(Mandatory=$false)] $Note = ""
)
$people = "A","B","C"
$randomhost = Get-Random $People
if ($randomhost -eq $speaker)
{
#for testing do until
#Write-Host "Host / host remove Both Match - ERROR" -ForegroundColor Red
do{
Remove-Variable $randomhost -ErrorAction SilentlyContinue
$randomhost = Get-Random $People
}
until ($randomhost -ne $speaker)
}
Write-Host ("Host: " + $randomhost) -ForegroundColor Magenta
$randomnote = Get-Random $People
if (($randomnote -eq $randomhost) -or ($randomnote -eq $note))
{
#for testing do until
#Write-Host "Both Match - ERROR" -ForegroundColor Red
do{
Remove-Variable $randomnote -ErrorAction SilentlyContinue
$randomnote = Get-Random $People
}
until (($randomnote -ne $randomhost) -and ($randomnote -ne $note))
}
Write-Host ("Note Taker: " + $randomnote) -ForegroundColor Green
}