forked from officecigar/windows_scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNetworking.ps1
82 lines (64 loc) · 3.88 KB
/
Networking.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<#
.SYNOPSIS
Creates a menu for scripts that you already have in a certain location. This will help you to centralize your scripts. You can aslo run your scripts from the menu, which will lauch a new powershell instance.
.EXAMPLE
navagate to here and run script.
C:\temp\toolsbox\met1.ps1
.EXAMPLE
Below is a screen example.
1. enableres.ps1
2. testgood.ps1
Enter selection: 2
.EXAMPLE
met1.ps1
.PARAMETER computername
one or more computername, or IP address... peace to America!
Think powershell think Mr-ITpro.com !!! FUN STUFF
.LINK
http://www.mr-itpro.com
#>
$currentuser = whoami
Write-Host " "
Write-Host " "
Write-Host " "
write-host -nonewline "Current user in ToolBox: " ; write-host -nonewline -f yellow "$currentuser"
Write-Host " "
Write-Host "###########################################################"
Write-Host " __________ "
Write-Host " / _/_ __/____ _________ "
Write-Host " / / / / / __ \/ ___/ __ \ "
Write-Host " _/ / / / / /_/ / / / /_/ / "
Write-Host " /___/ /_/ / .___/_/ \____/ "
Write-Host " /_/ "
#Write-Host " " -ForegroundColor Green -BackgroundColor black
Write-Host "###########################################################"
Write-Host " " -ForegroundColor white -BackgroundColor Red
Write-Host " " -ForegroundColor green -BackgroundColor White
Write-Host " " -ForegroundColor White -BackgroundColor Blue
Write-Host " "
Write-Host "###########################################################"
Write-Host " Please press Enter with NO selection To exit tool." -ForegroundColor Red
Write-Host " "
Write-Host "###########################################################"
Write-Host " Please Enter a number for the script you want to run." -ForegroundColor green
Write-Host " "
Write-Host "###########################################################"
Write-Host " "
Write-Host " "
$host.UI.RawUI.WindowTitle = "Trouble-shooting Networking - ToolxBox (Netwok Stack)"
$processes = ls -Path C:\scripts\TonyB\toolsbox\Networking
$menu = @{}
for ($i=1;$i -le $processes.count; $i++) {
Write-Host "$i. $($processes[$i-1].name)"
Write-Host ""
$menu.Add($i,($processes[$i-1].name))
}
[int]$ans = Read-Host 'Enter selection'
$selection = $menu.Item($ans)
Write-Host ""
if ($selection -eq $null){
exit
}
Get-ChildItem -Path C:\scripts\TonyB\toolsbox\Networking -name $selection | Start-Process PowerShell.exe -argument "-noexit -nologo -noprofile -command C:\scripts\TonyB\toolsbox\Networking\$selection"
powershell.exe C:\scripts\TonyB\toolsbox\networking.ps1
#start-process powershell.exe -argument "-noexit -nologo -noprofile -command c:\temp $selection"