用户菜单-功能执行

时间:2018-11-28 13:17:11

标签: powershell

新手

我有以下创建的power shell脚本。我想在完成每个开关的功能后返回到主菜单,我需要添加/更改什么?

[int]$UserMenu = 0
while ( $xUserMenu -lt 1 -or $xUserMenu -gt 4){
Write-host "1.Copy file based on keyword"
Write-host "2.Directory list export of directory"
Write-host "3.Exit"
[Int]$xUsermenu = read-host "Please enter an option" }
Switch( $xUsermenu ){
  1{some function}
  2{some function}
  3{exit}
}

0 个答案:

没有答案