-
Notifications
You must be signed in to change notification settings - Fork 0
/
skyEye.ps1
81 lines (61 loc) · 1.56 KB
/
skyEye.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
# powerShell script for finding Hidden directories
$userPath = $Home
$currentDor = pwd
Write-Host("1 For documets")
Write-Host("2 Entire system")
Write-Host("3 Custom path")
$choice = Read-Host("Enetr your choice")
function searchingIndocs {
$docs = "\documents"
$docf = $userPath + $docs
Set-Location $docf
Get-ChildItem -recurse -Hidden | ForEach-Object {$_.name}
}
function searchAll {
Set-Location "c:\"
Get-ChildItem -recurse -Hidden | ForEach-Object {$_.name}
}
function settingLoc {
param (
$loc
)
Set-Location $loc
Get-ChildItem -recurse -Hidden | ForEach-Object {$_.name}
}
function searchCustom {
param (
$custom
)
if (Test-path $custom) {
Write-Host("Searching in " +$custom)
Set-Location $custom
$count1=Get-ChildItem -recurse -Hidden
if( $count1.Count -eq 0){
Write-Host("No Hidden files Found")
}
else{
Get-ChildItem -recurse -Hidden | ForEach-Object {$_.name}
}
}
else {
Write-Host("Path Does not exits")
}
}
switch ($choice) {
1 {
searchingIndocs
settingLoc($currentDor)
}
2 {
searchAll
settingLoc($currentDor)
}
3{
$customPath = Read-Host("Enetr the custom path")
searchCustom($customPath)
settingLoc($currentDor)
}
default {
Write-Host("Enter the right choice")
}
}