Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##modelo para criar menus com funções no powershell
- function menu{
- Write-Host "=========ESCOLHA UMA OPÇÃO========="
- Write-Host "Aperte 1 para Listar o conteudo do diretorio"
- Write-Host "Aperte 2 para executar um ping para google.com"
- Write-Host "Aperte 3 para baixar um video da internet"
- Write-Host "Aperte 'q' para sair do script"
- }
- do {
- menu
- $escolha = Read-Host "Digite um numero: "
- switch($escolha){
- '1' {
- cls
- Get-ChildItem }
- '2' {
- cls
- ping -n 8 google.com }
- '3' {
- cls
- Invoke-WebRequest -Uri http://kingston-rp.org/mp3/psychobilly/The%20Grims%20-%20Ride%20To%20Solitude.mp3 -OutFile c:\users\eliel\Desktop\musica_script.mp3
- }
- 'q' {
- cls
- return }
- }
- pause
- }
- until($escolha -eq 'q')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement