Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function runFunction(){
- [int] $option = Read-Host("Please select your option below: `n 1) List Processes `n 2) List Services `n 3) Ping a Host `n 4) Doulbe a number `n 5) to exit `n")
- if ($option -eq 1){
- Get-Process
- Read-Host("Enter to continue")
- }
- elseif($option -eq 2){
- Get-Service
- Read-Host("Enter to continue")
- }
- elseif($option -eq 3){
- $target = Read-Host("Enter the host (IP/FQDN) you'd like to ping ")
- Test-Connection($target)
- #Read-Host("Enter to continue")
- }
- elseif($option -eq 4){
- [int] $number = Read-Host("Enter a number to be doubled ")
- Write-Host("Your original number was " + $number + ", but now it's " + ($number * 2))
- Read-Host("Enter to continue")
- }
- elseif($option -eq 5){
- exit
- }
- else{
- Write-Host("Invalid option, please select 1-4")
- }
- runFunction
- }
- runFunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement