Powershell Script help request

I have the following script:

#Disabling all ExchangeOnline Services to a specific mailbox
#Aug 2015, Ben Hart @ Unified Brands

Import-Module MSOnline
# Imports the O365 Commandlets

$CloudCredential=Get-Credential -Credential "user@domain.com"
# Saves your User name and password

$CloudSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://ps.outlook.com/powershell/" -Credential $CloudCredential -Authentication Basic -AllowRedirection -WarningAction SilentlyContinue

Import-PSSession $CloudSession -Prefix 365
# Sets the O365 Commands to start with 365

Connect-MsolService -Credential $CloudCredential
# Connects to O365 services

$user = read-host "Enter users email address to disable"

Set-365CasMailbox $user -PopEnabled $False
Set-365CasMailbox $user -ImapEnabled $False
Set-365CasMailbox $user -MapiEnabled $False
Set-365CasMailbox $user -OwaEnabled $False
Set-365CasMailbox $user -ActiveSyncEnabled $False

remove-pssession $CloudSession

Open in new window

I'd like to change the ending to a get-pssession and if nothing is returned display that there are no sessions that exist.  Like a confirmation that the session was closed successfully.
LVL 14
Ben HartAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You mean something like this?
if ( !(Get-PSSession) ){"no sessions"}

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ben HartAuthor Commented:
Possibly. How would I combine that with a write-host?
You can put anything you want inside the scriptblock portion (between the curly brackets) of the If statement.
Ben HartAuthor Commented:
Awesome.. and so easy.  Thanks!
Essentially, the existing "no sessions" is a Write-Output command.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.