如何小写变量扩展

How to lowercase a variable expansion

我声明了以下代码和变量。当扩展到下面的邮箱创建 cmdlet 时,如何确保 $shared_mailbox_alias 变为小写?因为它是基于 $Project_code 以大写字母输入的:

$Project_number = Read-Host -Prompt 'What is the Project Number ie. 02XXX'
$Project_code = Read-Host -Prompt 'What is the Project Code (in capital letters) ie. CRE'
$Project_name = Read-Host -Prompt 'What is the Project extended Name ie. Victoria Station Platform'

$shared_mailbox_displayname = "File: $Project_name"
$shared_mailbox_name = "$Project_code"
$shared_mailbox_alias = "file.$Project_code"

New-Mailbox -Shared -DisplayName $shared_mailbox_displayname -Name $shared_mailbox_name -Alias $shared_mailbox_alias -PrimarySmtpAddress $shared_mailbox_primarysmtp

我的目标是使用别名“file.abc”而不是“file.ABC”,并且我无法更改它作为输入 (ABC) 的方式,因为我还有其他 cmdlet使用该语法创建文件夹。

干杯

已解决,感谢您的输入,这是我使用的语法:

$shared_mailbox_alias = "file.$($Project_code.ToLower())"