Share via

Passing parameter in powershell

Mehdi 21 Reputation points
2022-01-09T15:22:55.573+00:00

Hi,
I am using a powershell script in MS Teams, however I find that it's failing to execute and I believe it's because of a parameter.
I have this parameter:

$phone="tel:+15552227777"
Set-CsUser -identity sipaddress -EnterpriseVoiceEnabled $true -HostedVoicemail $true -lineURI $phone

It does fail when I do this.
However, if I use this without a parameter it works:

Set-CsUser -identity sipaddress -EnterpriseVoiceEnabled $true -HostedVoicemail $true -lineURI "tel:+15552227777"

Any idea what is wrong?
Thanks

Microsoft Teams | Microsoft Teams for business | Other
0 comments No comments

Answer accepted by question author

Andreas Baumgarten 132.1K Reputation points MVP Volunteer Moderator
2022-01-09T16:01:54.823+00:00

Hi @Mehdi ,

What does It does fail when I do this. mean? Any error message?

Have you tried this?

$phone="tel:+15552227777"  
Set-CsUser -identity sipaddress -EnterpriseVoiceEnabled $true -HostedVoicemail $true -lineURI "$phone"  

----------

(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

Regards
Andreas Baumgarten

Was this answer helpful?


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.