简介:
本文提供示例脚本,介绍如何使用switch命令制作Powershell命令菜单。脚本内容是服务器的初始化配置,提供了一个基本的框架,具体内容可以根据实际情况编写。
While($InNumber -ne 7)
{
Write-Host "#######################################################" -ForegroundColor Green
Write-Host "# 1. Set Computer Description; #"
Write-Host "# 2. Activate OS; #"
Write-Host "# 3. Enable Remote Desktop; #"
Write-Host "# 4. Disable Host Firewall; #"
Write-Host "# 5. Rename Computer and Restart; #"
Write-Host "# 6. Join Domain & Move OU and Restart; #"
Write-Host "# 7. Exit #"
Write-Host "#######################################################" -ForegroundColor Green