shabbarankers
Technical User
Hi,
Im trying to build a menu system within powershell to do various functions and Ive hit a bit of a stumbling block. I was wondering if someone could assist me with it and say where Im going wrong please?
Im trying to build a menu system within powershell to do various functions and Ive hit a bit of a stumbling block. I was wondering if someone could assist me with it and say where Im going wrong please?
Code:
$MainMenu=
wrte-host ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
write-host "Office 365 and Exchange Online Management"
write-host
write-host "Press 1: To Manage Office 365 Functions"
write-host "Press 2: To Manage Exchange Online Functions"
write-host "Press Q: To Quit"
write-host
write-host
write-host ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
$Selection = Read-Host $MainMenu
Switch ($Selection) {
"1" {
Write-Host "Connecting To Office 365" -ForegroundColor Green
#Needs thinking about - Tasks etc
}
"2" {
Write-Host "Connecting To Exchange Online" -ForegroundColor Green
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri [URL unfurl="true"]https://outlook.office365.com/powershell-liveid/[/URL] -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
cls
$ExchangeMenu=
wrte-host ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
write-host "Exchange Online Management"
write-host
write-host "Press 1: To Do Stuff"
write-host "Press 2: To Do More Stuff"
write-host "Press Q To Exit"
write-host
write-host
write-host ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
}
"Q" {
Write-Host "Exiting Console" -ForegroundColor Green
}
}