我不是一个伟大的脚本编写者,而且我在翻译中迷失了......也许我做的完全错误......
我正在构建一个脚本,我希望用户从选项列表中进行选择,特别是一年中的月份。该结果稍后将在脚本中使用。
这是片段:
$optionQuit = New-Object System.Management.Automation.Host.ChoiceDescription "Quit", "Quit"
$option1 = New-Object System.Management.Automation.Host.ChoiceDescription "01-January", "01-January OU"
$option2 = New-Object System.Management.Automation.Host.ChoiceDescription "02-February", "02-February OU"
$option3 = New-Object System.Management.Automation.Host.ChoiceDescription "03-March", "03-March OU"
$option4 = New-Object System.Management.Automation.Host.ChoiceDescription "04-April", "04-April OU"
$option5 = New-Object System.Management.Automation.Host.ChoiceDescription "05-May", "05-May OU"
$option6 = New-Object System.Management.Automation.Host.ChoiceDescription "06-June", "06-June OU"
$option7 = New-Object System.Management.Automation.Host.ChoiceDescription "07-July", "07-July OU"
$option8 = New-Object System.Management.Automation.Host.ChoiceDescription "08-August", "08-August OU"
$option9 = New-Object System.Management.Automation.Host.ChoiceDescription "09-September", "09-September OU"
$option10 = New-Object System.Management.Automation.Host.ChoiceDescription "10-October", "10-October OU"
$option11 …Run Code Online (Sandbox Code Playgroud) powershell ×1