-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathWindowsNinja.ps1
52 lines (46 loc) · 1.43 KB
/
WindowsNinja.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
function Print-Banner {
$banner = @(
"******************************************",
"* WindowsNinja *",
"* Windows System Info Tool *",
"* v1.3.1 *",
"* ---------------------------- *",
"* by @ImKKingshuk *",
"* Github- https://github.com/ImKKingshuk *",
"******************************************"
)
$width = (Get-Host).UI.RawUI.WindowSize.Width
foreach ($line in $banner) {
Write-Host ($line.PadLeft(([math]::Floor(($width + $line.Length) / 2)))) -ForegroundColor Cyan
}
Write-Host
}
function Show-Menu {
Print-Banner
Write-Host "======= WindowsNinja ========"
Write-Host "1. General System Information"
Write-Host "2. Hardware Information"
Write-Host "3. Exit"
Write-Host "============================="
}
function Get-GeneralSystemInfo {
Clear-Host
.\OS.ps1
.\PC.ps1
Read-Host "Press Enter to return to the main menu"
}
function Get-HardwareInfo {
Clear-Host
.\PC.ps1
Read-Host "Press Enter to return to the main menu"
}
while ($true) {
Show-Menu
$choice = Read-Host "Enter your choice (1, 2, or 3)"
switch ($choice) {
"1" { Get-GeneralSystemInfo }
"2" { Get-HardwareInfo }
"3" { break }
default { Write-Host "Invalid choice. Please try again." }
}
}