-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGet-FolderFiles.ps1
More file actions
25 lines (22 loc) · 994 Bytes
/
Copy pathGet-FolderFiles.ps1
File metadata and controls
25 lines (22 loc) · 994 Bytes
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
function GetFolderFiles{
#Abfrage des Pfades
Write-Host -ForegroundColor Cyan -NoNewline "Bitte gib den Pfad des Ordners ein: "
$FolderPath = Read-Host
Write-Host -ForegroundColor Cyan -NoNewline "Sollen Unterordner mit eingeschlossen werden? (J/N): "
$UserInput1 = Read-Host
if($UserInput1 -eq "j" -or $UserInput1 -eq "J"){
Write-Host -ForegroundColor Green "Hier deine Auflistung: "
Get-ChildItem -Path $FolderPath -Recurse | Select-Object Name, DirectoryName | Format-Table -AutoSize
}
else{
Write-Host -ForegroundColor Green "Hier deine Auflistung: "
Get-ChildItem -Path $FolderPath | Select-Object Name, DirectoryName | Format-Table -AutoSize
}
Write-Host -ForegroundColor Cyan -NoNewline "Moechtest du einen weiteren Pfad pruefen? (J/N) :"
$UserInput2 = Read-Host
if($UserInput2 -eq "j" -or $UserInput2 -eq "J"){
Clear-Host
GetFolderFiles
}
}
GetFolderFiles