Avatar of Kelly Garcia
Kelly Garcia
Flag for United Kingdom of Great Britain and Northern Ireland asked on

powershell string change text to lowercase

Hi All,

I have this line of code:
$ServiceBusRuleId = (Get-AzureRmEventHubAuthorizationRule -ResourceGroupName "poc-eventhub" -Namespace "poc-eventhub-defra").id 

Open in new window

this returns the following value:

$ServiceBusRuleId = /subscriptions/c7c95a-30-4ef4-bfa4-49107461/resourceps/p-eventhub/providers/Microsoft.EventHub/namespaces/p-eventhub-kay/AuthorizationRules/RootManageSharedAccessKey

Open in new window

i need it to convert the AuthorizationRules into lowercase . what is the best way to achieve this?

Avatar of undefined
Last Comment
Kelly Garcia

8/22/2022 - Mon

$ServiceBusRuleId = (Get-AzureRmEventHubAuthorizationRule -ResourceGroupName "poc-eventhub" -Namespace "poc-eventhub-defra").id
$lowerServiceBusRuleId = "$($ServiceBusRuleId)".ToLower()

Open in new window

The double quotes around the variable make sure it's actually a string; can't test it at the moment.
will work as well if the value returned is already a string.
Kelly Garcia


thank you for your feedback, problem with this that it will make everything lowercase and this string is case sensitive, i only want the authorisationid to be lowercase.


Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Kelly Garcia

thank you!
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes