Microsoft Surface Hub 2 SmCamera User Manual
Page 542

{
Remove-PSSession
$sessCS
}
}
function
PrintError($strMsg)
{
Write-Host
$strMsg
-foregroundcolor
"red"
}
function
PrintSuccess($strMsg)
{
Write-Host
$strMsg
-foregroundcolor
"green"
}
# Cleans up and prints an error message
function
CleanupAndFail($strMsg)
{
if
($strMsg)
{
PrintError($strMsg);
}
Cleanup
exit
1
}
# Exits if there is an error set and prints the given message
function
ExitIfError($strMsg)
{
if
($Error)
{
CleanupAndFail($strMsg);
}
}
## Check dependencies ##
$input =
Read-Host
"Is the account you wish to enable part of an online
environment (enter O) or on-premises environment (enter P)"
if
($input -eq
"P"
)
{
$online =
$false
}
elseif
($input -eq
"O"
)
{
$online =
$true
}
else
{
CleanupAndFail
"Invalid selection"
}
if
($online)
{
try
{
Import-Module
SkypeOnlineConnector