mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-14 14:58:47 +02:00
Add datatype to param()
This commit is contained in:
@ -11,10 +11,11 @@
|
||||
Author: Markus Fleschutz / License: CC0
|
||||
#>
|
||||
|
||||
param($DirTree = "")
|
||||
if ($DirTree -eq "" ) { $DirTree = read-host "Enter the path to the directory tree" }
|
||||
param([string]$DirTree = "")
|
||||
|
||||
try {
|
||||
if ($DirTree -eq "" ) { $DirTree = read-host "Enter the path to the directory tree" }
|
||||
|
||||
$Folders = @()
|
||||
foreach ($Folder in (Get-ChildItem -path "$DirTree" -Recurse | Where { $_.PSisContainer })) {
|
||||
$Folders += New-Object PSObject -Property @{
|
||||
|
Reference in New Issue
Block a user